|
@@ -1,6 +1,11 @@
|
1
|
1
|
import 'package:flutter/material.dart';
|
|
2
|
+import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
3
|
+import 'package:get/get.dart';
|
|
4
|
+import 'package:get_storage/get_storage.dart';
|
|
5
|
+import 'package:worker_client/widgets/GradientButton.dart';
|
|
6
|
+import 'package:worker_client/widgets/MyCell/index.dart';
|
2
|
7
|
import 'package:worker_client/widgets/layout/BasicPage.dart';
|
3
|
|
-
|
|
8
|
+import '/widgets/MyDialog.dart' as modal;
|
4
|
9
|
|
5
|
10
|
class Main extends BasicPage {
|
6
|
11
|
Main({Key? key}) : super(key: key) {
|
|
@@ -8,14 +13,289 @@ class Main extends BasicPage {
|
8
|
13
|
naviTitle = '我的';
|
9
|
14
|
}
|
10
|
15
|
|
|
16
|
+ GetStorage box = GetStorage();
|
|
17
|
+
|
|
18
|
+ void loginOut() {
|
|
19
|
+ modal.showAlert(
|
|
20
|
+ title: '提示',
|
|
21
|
+ message: '确定要退出登陆吗?',
|
|
22
|
+ onConfirm: () {
|
|
23
|
+ box.remove('token');
|
|
24
|
+ Get.offNamed('/login');
|
|
25
|
+ return true;
|
|
26
|
+ },
|
|
27
|
+ onCancel: () => true);
|
|
28
|
+ }
|
|
29
|
+ void goMachinery(){
|
|
30
|
+ Get.toNamed('/machineryList');
|
|
31
|
+ }
|
|
32
|
+
|
11
|
33
|
@override
|
12
|
34
|
Widget builder(BuildContext context) {
|
13
|
|
- return Column(
|
14
|
|
- children: [
|
15
|
|
- Container(
|
16
|
|
-
|
17
|
|
- )
|
18
|
|
- ],
|
|
35
|
+ return Container(
|
|
36
|
+ decoration: const BoxDecoration(color: Colors.white),
|
|
37
|
+ child: ListView(
|
|
38
|
+ children: [
|
|
39
|
+ Stack(
|
|
40
|
+ children: [
|
|
41
|
+ Positioned(
|
|
42
|
+ top: 0,
|
|
43
|
+ child: Container(
|
|
44
|
+ width: 375.w,
|
|
45
|
+ height: 187.5.w,
|
|
46
|
+ decoration: const BoxDecoration(
|
|
47
|
+ image: DecorationImage(
|
|
48
|
+ image: AssetImage("images/main/userBgi.png"),
|
|
49
|
+ fit: BoxFit.cover,
|
|
50
|
+ ),
|
|
51
|
+ ),
|
|
52
|
+ child: Row(
|
|
53
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
54
|
+ children: [
|
|
55
|
+ Container(
|
|
56
|
+ margin: EdgeInsets.fromLTRB(40.w, 0, 10.w, 0),
|
|
57
|
+ child: Image.asset(
|
|
58
|
+ 'images/main/defaultAvatar.png',
|
|
59
|
+ width: 63.w,
|
|
60
|
+ height: 63.w,
|
|
61
|
+ ),
|
|
62
|
+ ),
|
|
63
|
+ Column(
|
|
64
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
65
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
66
|
+ children: [
|
|
67
|
+ Text(
|
|
68
|
+ '姓名',
|
|
69
|
+ style: TextStyle(
|
|
70
|
+ color: Colors.white,
|
|
71
|
+ fontWeight: FontWeight.w500,
|
|
72
|
+ fontSize: 17.sp,
|
|
73
|
+ letterSpacing: 2,
|
|
74
|
+ shadows: [
|
|
75
|
+ BoxShadow(
|
|
76
|
+ color: const Color(0x66000000),
|
|
77
|
+ offset: Offset(0, 1.w),
|
|
78
|
+ blurRadius: 0)
|
|
79
|
+ ]),
|
|
80
|
+ ),
|
|
81
|
+ Container(
|
|
82
|
+ margin: EdgeInsets.fromLTRB(0, 19.h, 0, 0),
|
|
83
|
+ child: Text(
|
|
84
|
+ '手机号',
|
|
85
|
+ style: TextStyle(
|
|
86
|
+ color: Colors.white,
|
|
87
|
+ fontWeight: FontWeight.w500,
|
|
88
|
+ fontSize: 17.sp,
|
|
89
|
+ letterSpacing: 2,
|
|
90
|
+ shadows: [
|
|
91
|
+ BoxShadow(
|
|
92
|
+ color: const Color(0x66000000),
|
|
93
|
+ offset: Offset(0, 1.w),
|
|
94
|
+ blurRadius: 0)
|
|
95
|
+ ]),
|
|
96
|
+ ),
|
|
97
|
+ )
|
|
98
|
+ ],
|
|
99
|
+ )
|
|
100
|
+ ],
|
|
101
|
+ ),
|
|
102
|
+ ),
|
|
103
|
+ ),
|
|
104
|
+ Positioned(
|
|
105
|
+ right: 0,
|
|
106
|
+ top: 0,
|
|
107
|
+ child: Container(
|
|
108
|
+ decoration: const BoxDecoration(color: Color(0xb2000000)),
|
|
109
|
+ child: Text(
|
|
110
|
+ '该账号归。。。所属',
|
|
111
|
+ style: TextStyle(color: Colors.white, fontSize: 12.sp),
|
|
112
|
+ ),
|
|
113
|
+ ),
|
|
114
|
+ ),
|
|
115
|
+ Column(
|
|
116
|
+ children: [
|
|
117
|
+ Container(
|
|
118
|
+ margin: EdgeInsets.fromLTRB(15.w, 187.5.w - 15.h, 15.w, 0),
|
|
119
|
+ height: 101.h,
|
|
120
|
+ decoration: BoxDecoration(
|
|
121
|
+ color: Colors.white,
|
|
122
|
+ borderRadius: BorderRadius.all(Radius.circular(20.w)),
|
|
123
|
+ boxShadow: [
|
|
124
|
+ BoxShadow(
|
|
125
|
+ color: const Color(0x14000000),
|
|
126
|
+ offset: const Offset(0, 0),
|
|
127
|
+ blurRadius: 22.w,
|
|
128
|
+ ),
|
|
129
|
+ ]),
|
|
130
|
+ child: Row(
|
|
131
|
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
132
|
+ children: [
|
|
133
|
+ GestureDetector(
|
|
134
|
+ onTap:(){
|
|
135
|
+ goMachinery();
|
|
136
|
+ },
|
|
137
|
+ child: Column(
|
|
138
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
139
|
+ children: [
|
|
140
|
+ Image.asset(
|
|
141
|
+ 'images/main/machinery.png',
|
|
142
|
+ width: 30.w,
|
|
143
|
+ ),
|
|
144
|
+ Text(
|
|
145
|
+ '我的农机',
|
|
146
|
+ style: TextStyle(
|
|
147
|
+ fontSize: 17.sp,
|
|
148
|
+ fontWeight: FontWeight.bold,
|
|
149
|
+ color: Color(0xFF333333)),
|
|
150
|
+ )
|
|
151
|
+ ],
|
|
152
|
+ ),
|
|
153
|
+ ),
|
|
154
|
+ Column(
|
|
155
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
156
|
+ children: [
|
|
157
|
+ Image.asset(
|
|
158
|
+ 'images/main/wallet.png',
|
|
159
|
+ width: 30.w,
|
|
160
|
+ ),
|
|
161
|
+ Text(
|
|
162
|
+ '我的钱包',
|
|
163
|
+ style: TextStyle(
|
|
164
|
+ fontSize: 17.sp,
|
|
165
|
+ fontWeight: FontWeight.bold,
|
|
166
|
+ color: Color(0xFF333333)),
|
|
167
|
+ )
|
|
168
|
+ ],
|
|
169
|
+ ),
|
|
170
|
+ Column(
|
|
171
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
172
|
+ children: [
|
|
173
|
+ Image.asset(
|
|
174
|
+ 'images/main/bankCard.png',
|
|
175
|
+ width: 30.w,
|
|
176
|
+ ),
|
|
177
|
+ Text(
|
|
178
|
+ '我的银行卡',
|
|
179
|
+ style: TextStyle(
|
|
180
|
+ fontSize: 17.sp,
|
|
181
|
+ fontWeight: FontWeight.bold,
|
|
182
|
+ color: Color(0xFF333333)),
|
|
183
|
+ )
|
|
184
|
+ ],
|
|
185
|
+ ),
|
|
186
|
+ ],
|
|
187
|
+ ),
|
|
188
|
+ ),
|
|
189
|
+ Container(
|
|
190
|
+ margin: EdgeInsets.fromLTRB(0, 15.h, 0, 0),
|
|
191
|
+ padding:
|
|
192
|
+ EdgeInsets.symmetric(horizontal: 15.w, vertical: 0),
|
|
193
|
+ child: Column(
|
|
194
|
+ children: [
|
|
195
|
+ MyCell(
|
|
196
|
+ head: Image.asset(
|
|
197
|
+ 'images/main/account.png',
|
|
198
|
+ width: 19.w,
|
|
199
|
+ ),
|
|
200
|
+ body: Text(
|
|
201
|
+ '账号与安全',
|
|
202
|
+ style: TextStyle(
|
|
203
|
+ fontSize: 17.sp,
|
|
204
|
+ color: Color(0xff333333),
|
|
205
|
+ fontWeight: FontWeight.bold,
|
|
206
|
+ ),
|
|
207
|
+ ),
|
|
208
|
+ action: Image.asset(
|
|
209
|
+ 'images/main/goto.png',
|
|
210
|
+ width: 10.w,
|
|
211
|
+ ),
|
|
212
|
+ onClick: () {},
|
|
213
|
+ ),
|
|
214
|
+ MyCell(
|
|
215
|
+ head: Image.asset(
|
|
216
|
+ 'images/main/aboutUs.png',
|
|
217
|
+ width: 19.w,
|
|
218
|
+ ),
|
|
219
|
+ body: Text(
|
|
220
|
+ '关于我们',
|
|
221
|
+ style: TextStyle(
|
|
222
|
+ fontSize: 17.sp,
|
|
223
|
+ fontWeight: FontWeight.bold,
|
|
224
|
+ color: Color(0xff333333)),
|
|
225
|
+ ),
|
|
226
|
+ action: Image.asset(
|
|
227
|
+ 'images/main/goto.png',
|
|
228
|
+ width: 10.w,
|
|
229
|
+ ),
|
|
230
|
+ onClick: () {},
|
|
231
|
+ ),
|
|
232
|
+ MyCell(
|
|
233
|
+ head: Image.asset(
|
|
234
|
+ 'images/main/update.png',
|
|
235
|
+ width: 19.w,
|
|
236
|
+ ),
|
|
237
|
+ body: Text(
|
|
238
|
+ '用户协议及隐私政策',
|
|
239
|
+ style: TextStyle(
|
|
240
|
+ fontSize: 17.sp,
|
|
241
|
+ fontWeight: FontWeight.bold,
|
|
242
|
+ color: Color(0xff333333)),
|
|
243
|
+ ),
|
|
244
|
+ action: Image.asset(
|
|
245
|
+ 'images/main/goto.png',
|
|
246
|
+ width: 10.w,
|
|
247
|
+ ),
|
|
248
|
+ onClick: () {},
|
|
249
|
+ ),
|
|
250
|
+ MyCell(
|
|
251
|
+ head: Image.asset(
|
|
252
|
+ 'images/main/Feedback.png',
|
|
253
|
+ width: 19.w,
|
|
254
|
+ ),
|
|
255
|
+ body: Text(
|
|
256
|
+ '意见反馈',
|
|
257
|
+ style: TextStyle(
|
|
258
|
+ fontSize: 17.sp,
|
|
259
|
+ fontWeight: FontWeight.bold,
|
|
260
|
+ color: Color(0xff333333)),
|
|
261
|
+ ),
|
|
262
|
+ action: Image.asset(
|
|
263
|
+ 'images/main/goto.png',
|
|
264
|
+ width: 10.w,
|
|
265
|
+ ),
|
|
266
|
+ onClick: () {},
|
|
267
|
+ ),
|
|
268
|
+ Container(
|
|
269
|
+ height: 45.5.h,
|
|
270
|
+ width: 345.w,
|
|
271
|
+ margin: EdgeInsets.only(top: 30.h, bottom: 30.h),
|
|
272
|
+ child: GradientButton(
|
|
273
|
+ colors: const [
|
|
274
|
+ Color(0xFFF8F8F8),
|
|
275
|
+ Color(0xFFF8F8F8)
|
|
276
|
+ ],
|
|
277
|
+ borderRadius:
|
|
278
|
+ BorderRadius.all(Radius.circular(24.5.w)),
|
|
279
|
+ onPressed: () {
|
|
280
|
+ loginOut();
|
|
281
|
+ },
|
|
282
|
+ child: Text(
|
|
283
|
+ "退出登陆",
|
|
284
|
+ style: TextStyle(
|
|
285
|
+ fontSize: 20.sp,
|
|
286
|
+ fontWeight: FontWeight.bold,
|
|
287
|
+ color: const Color(0xFF333333),
|
|
288
|
+ ),
|
|
289
|
+ )))
|
|
290
|
+ ],
|
|
291
|
+ ),
|
|
292
|
+ ),
|
|
293
|
+ ],
|
|
294
|
+ )
|
|
295
|
+ ],
|
|
296
|
+ )
|
|
297
|
+ ],
|
|
298
|
+ ),
|
19
|
299
|
);
|
20
|
300
|
}
|
21
|
301
|
}
|