forked from bukunmialuko/flutter_ui_kit_obkm
-
Notifications
You must be signed in to change notification settings - Fork 2
/
page_12.dart
210 lines (205 loc) · 7.28 KB
/
page_12.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/svg.dart';
import 'package:flutter_ui_kit_obkm/src/navigation/navigation_service.dart';
import 'package:flutter_ui_kit_obkm/src/res/assets.dart';
import 'package:get_it/get_it.dart';
class Page12 extends StatefulWidget {
const Page12({Key? key}) : super(key: key);
@override
_Page12State createState() => _Page12State();
}
class _Page12State extends State<Page12> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: const Color(0xFFFCFCFC),
appBar: AppBar(
centerTitle: true,
backgroundColor: const Color(0xFFFCFCFC),
title: Text(
'SMART ROOM',
style: TextStyle(
fontWeight: FontWeight.w900,
color: Colors.black,
),
),
elevation: 0.0,
),
body: SafeArea(
child: Padding(
padding: EdgeInsets.fromLTRB(23.w, 30.h, 23.w, 0),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Living room',
style: TextStyle(
fontSize: 24.sp,
fontWeight: FontWeight.w600,
color: Colors.black,
),
),
SizedBox(height: 16.h),
Padding(
padding: EdgeInsets.only(right: 30.w),
child: Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed leo quis parturient tristique mauris. Amet urna tortor tortor duis tellus risus.',
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
height: 1.43,
),
),
),
Divider(
height: 32.h, color: const Color(0xFFD0D0D0), thickness: 1),
_titleWidget('Family Members Access'),
Padding(
padding: EdgeInsets.symmetric(vertical: 24.h),
child: SizedBox(
height: 61.h,
child: ListView.separated(
shrinkWrap: true,
scrollDirection: Axis.horizontal,
itemBuilder: (_, index) => Stack(
alignment: AlignmentDirectional.center,
children: [
CircleAvatar(
radius: 31.w,
backgroundColor: const Color(0xFFC4C4C4),
backgroundImage: NetworkImage(
'https://source.unsplash.com/random/education',
),
),
Positioned(
right: 2.w,
bottom: 0,
child: CircleAvatar(
radius: 8.w,
backgroundColor: const Color(0xFFFCFCFC),
child: const Icon(
Icons.check_circle_outline_rounded,
color: Color(0xFF161616),
size: 15,
),
),
),
],
),
separatorBuilder: (_, index) => SizedBox(width: 16.w),
itemCount: 4,
),
),
),
Padding(
padding: EdgeInsets.only(right: 30.w),
child: Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed leo quis parturient tristique mauris. ',
style: TextStyle(
color: Colors.black,
fontSize: 14.sp,
fontWeight: FontWeight.w400,
height: 1.43,
),
),
),
Divider(
height: 60.h, color: const Color(0xFFD0D0D0), thickness: 1),
_titleWidget('Devices in living room'),
SizedBox(height: 19.h),
Wrap(
spacing: 10.w,
runSpacing: 17.h,
children: [
_livingRoomItem(
name: 'Lights', iconPath: Assets.PG12_LIGHT),
_livingRoomItem(name: 'Sofa', iconPath: Assets.PG12_SOFA),
_livingRoomItem(
name: 'Fridge', iconPath: Assets.PG12_FRIDGE),
_livingRoomItem(
name: 'Fridge',
iconPath: Assets.PG12_FAN,
available: false,
),
_livingRoomItem(
name: 'Fridge',
iconPath: Assets.PG12_AIR_CONDITIONER,
warning: true,
),
],
)
],
),
),
),
),
);
}
Widget _livingRoomItem(
{required String name,
required String iconPath,
bool available = true,
bool warning = false}) =>
Opacity(
opacity: available ? 1 : 0.2,
child: Container(
width: 107.w,
height: 130.h,
padding: EdgeInsets.symmetric(horizontal: 14.w, vertical: 13.h),
decoration: BoxDecoration(
color: const Color(0xFFF4F4F4),
borderRadius: BorderRadius.circular(4.r),
boxShadow: [
BoxShadow(
offset: const Offset(0, 1),
blurRadius: 4,
color: Colors.black.withOpacity(.25),
)
]),
child: Column(
children: [
Align(
alignment: Alignment.topRight,
child: CircleAvatar(
radius: 5.w,
backgroundColor: warning
? const Color(0xFFF1C21B)
: const Color(0xFF24A148),
),
),
SvgPicture.asset(iconPath),
const Expanded(child: SizedBox()),
Text(
name,
style: TextStyle(
color: Colors.black,
fontSize: 12.sp,
fontWeight: FontWeight.w600,
),
),
],
),
),
);
Widget _titleWidget(String title) => Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 16.sp,
color: Colors.black,
),
),
GestureDetector(
onTap: () {
GetIt.I.get<NavigationService>().back();
},
child: const Icon(Icons.add_circle, color: Colors.black)),
],
);
}