[baozhangchao] 3 anos atrás
pai
commit
5e64ba0fc6

BIN
images/HomesNOImgaes.png Ver arquivo


BIN
images/HomesOFFImgaes.png Ver arquivo


BIN
images/MineNOImgaes.png Ver arquivo


BIN
images/MineOFFImgaes.png Ver arquivo


BIN
images/OrdersNOImgaes.png Ver arquivo


BIN
images/OrdersOFFImgaes.png Ver arquivo


BIN
images/newsOFFImages.png Ver arquivo


BIN
images/newsONImages.png Ver arquivo


+ 27
- 0
lib/components/UI/CarsCard.dart Ver arquivo

@@ -0,0 +1,27 @@
1
+import 'package:flutter/material.dart';
2
+
3
+
4
+
5
+class CarsCard extends StatelessWidget {
6
+  const CarsCard({Key? key}) : super(key: key);
7
+
8
+  @override
9
+  Widget build(BuildContext context) {
10
+
11
+    final Object Item;
12
+
13
+    return Container(
14
+width: 20.0,
15
+      decoration: const BoxDecoration(
16
+        image: DecorationImage(
17
+          image: AssetImage("images/icon_login.png"),
18
+          fit: BoxFit.cover,
19
+        ),
20
+      ),
21
+    );
22
+
23
+  }
24
+}
25
+
26
+
27
+

+ 5
- 3
lib/main.dart Ver arquivo

@@ -1,11 +1,12 @@
1 1
 import 'dart:async';
2 2
 
3 3
 import 'package:farmer_client/models/Store.dart';
4
+import 'package:farmer_client/pages/TabBar/index_page.dart';
4 5
 import 'package:farmer_client/pages/login/login.dart';
5 6
 import 'package:flutter/material.dart';
6 7
 import 'package:get/get.dart';
7 8
 import 'package:flutter_screenutil/flutter_screenutil.dart';
8
-
9
+import 'components/UI/CarsCard.dart';
9 10
 import 'components/UI/DefaultButton.dart';
10 11
 
11 12
 void main() {
@@ -34,8 +35,8 @@ class MyApp extends StatelessWidget {
34 35
         // is not restarted.
35 36
         primarySwatch: Colors.blue,
36 37
       ),
37
-      home: const MyHomePage(title: 'Flutter Demo Home Page'),
38
-        // IndexPage()
38
+      home:  const MyHomePage(title: 'Flutter Demo Home Page'),
39
+
39 40
     );
40 41
   }
41 42
 }
@@ -131,6 +132,7 @@ class _MyHomePageState extends State<MyHomePage> {
131 132
                 );
132 133
               },
133 134
             ),
135
+            CarsCard()
134 136
           ],
135 137
         ),
136 138
       ),

+ 90
- 69
lib/pages/TabBar/index_page.dart Ver arquivo

@@ -1,71 +1,92 @@
1
-import 'package:flutter/material.dart';
2
-import 'package:flutter/cupertino.dart';
3
-import 'home_page.dart';
4
-import 'Information_page.dart';
5
-import 'Mine_page.dart';
6
-import 'Orders_page.dart';
1
+// import 'package:flutter/material.dart';
2
+// import 'package:flutter/cupertino.dart';
3
+// import 'home_page.dart';
4
+// import 'Information_page.dart';
5
+// import 'Mine_page.dart';
6
+// import 'Orders_page.dart';
7
+//
8
+// class IndexPage extends StatefulWidget {
9
+//   const IndexPage({Key? key}) : super(key: key);
10
+//
11
+//   @override
12
+//   _IndexPageState createState() => _IndexPageState();
13
+// }
14
+//
15
+// class _IndexPageState extends State<IndexPage> {
16
+//   List bottom_icons = [
17
+//     'assets/images/HomesNOImgaes.png',
18
+//     "assets/images/MineNOImgaes.png",
19
+//     "assets/images/newsOFFImages.png",
20
+//     "assets/images/OrdersNOImgaes.png",
21
+//   ];
22
+//   List bottom_select_icons = [
23
+//     'assets/images/HomesOFFImgaes.png',
24
+//     "assets/images/MineOFFImgaes.png",
25
+//     "assets/images/newsONImages.png",
26
+//     "assets/images/OrdersOFFImgaes.png",
27
+//   ];
28
+//
29
+//
30
+//
31
+//
32
+//
33
+//   final List<BottomNavigationBarItem> bottomTabs = [
34
+//      BottomNavigationBarItem(
35
+//       icon: Icon(CupertinoIcons.home),
36
+//        label:'首页',
37
+//     ),
38
+//      BottomNavigationBarItem(
39
+//       icon: Icon(CupertinoIcons.search),
40
+//        label: '资讯',
41
+//
42
+//     ),
43
+//      BottomNavigationBarItem(
44
+//       icon: Icon(CupertinoIcons.shopping_cart),
45
+//        label: '订单',
46
+//
47
+//     ),
48
+//      BottomNavigationBarItem(
49
+//       icon: Icon(CupertinoIcons.profile_circled),
50
+//        label: '我的',
51
+//     ),
52
+//   ];
53
+//
54
+//   final List tabBodies = [
55
+//     HomePage(),
56
+//     InformationPage(),
57
+//     OrdersPage(),
58
+//     MinePage(),
59
+//   ];
60
+//
61
+//   int currentIndex = 0;
62
+//   var currentPage;
63
+//
64
+//   @override
65
+//   void initState() {
66
+//     super.initState();
67
+//     currentPage = tabBodies[currentIndex];
68
+//
69
+//   }
70
+//
71
+//   @override
72
+//   Widget build(BuildContext context) {
73
+//     // TODO: implement build
74
+//     return Scaffold(
75
+//       backgroundColor: Color.fromRGBO(244, 245, 245, 1),
76
+//       bottomNavigationBar: BottomNavigationBar(
77
+//         type: BottomNavigationBarType.fixed,
78
+//         currentIndex: currentIndex,
79
+//         items: bottomTabs,
80
+//         onTap: (index){
81
+//           setState(() {
82
+//             currentIndex = index;
83
+//             currentPage = tabBodies[currentIndex];
84
+//           });
85
+//         },
86
+//       ),
87
+//       body: currentPage,
88
+//     );
89
+//   }
90
+// }
7 91
 
8
-class IndexPage extends StatefulWidget {
9
-  _IndexPageState createState() => _IndexPageState();
10
-}
11 92
 
12
-class _IndexPageState extends State<IndexPage> {
13
-
14
-
15
-  final List<BottomNavigationBarItem> bottomTabs = [
16
-     BottomNavigationBarItem(
17
-      icon: Icon(CupertinoIcons.home),
18
-      title: Text('首页'),
19
-    ),
20
-     BottomNavigationBarItem(
21
-      icon: Icon(CupertinoIcons.search),
22
-      title: Text('资讯'),
23
-
24
-    ),
25
-     BottomNavigationBarItem(
26
-      icon: Icon(CupertinoIcons.shopping_cart),
27
-      title: Text('订单'),
28
-
29
-    ),
30
-     BottomNavigationBarItem(
31
-      icon: Icon(CupertinoIcons.profile_circled),
32
-      title: Text('我的'),
33
-    ),
34
-  ];
35
-
36
-  final List tabBodies = [
37
-    HomePage(),
38
-    InformationPage(),
39
-    OrdersPage(),
40
-    MinePage(),
41
-  ];
42
-
43
-  int currentIndex = 0;
44
-  var currentPage;
45
-
46
-  @override
47
-  void initState() {
48
-    super.initState();
49
-    currentPage = tabBodies[currentIndex];
50
-  }
51
-
52
-  @override
53
-  Widget build(BuildContext context) {
54
-    // TODO: implement build
55
-    return Scaffold(
56
-      backgroundColor: Color.fromRGBO(244, 245, 245, 1),
57
-      bottomNavigationBar: BottomNavigationBar(
58
-        type: BottomNavigationBarType.fixed,
59
-        currentIndex: currentIndex,
60
-        items: bottomTabs,
61
-        onTap: (index){
62
-          setState(() {
63
-            currentIndex = index;
64
-            currentPage = tabBodies[currentIndex];
65
-          });
66
-        },
67
-      ),
68
-      body: currentPage,
69
-    );
70
-  }
71
-}

+ 211
- 222
lib/pages/login/login.dart Ver arquivo

@@ -1,6 +1,7 @@
1 1
 import 'dart:async';
2
-
3
-import 'package:farmer_client/components/UI/DefaultButton.dart';
2
+import 'dart:ffi';
3
+import 'package:fluttertoast/fluttertoast.dart';
4
+import 'package:flutter/gestures.dart';
4 5
 import 'package:flutter/material.dart';
5 6
 import 'package:flutter_screenutil/flutter_screenutil.dart';
6 7
 
@@ -13,36 +14,26 @@ class MyRouteLogin extends StatefulWidget {
13 14
 }
14 15
 
15 16
 class _RouteLogin extends State<MyRouteLogin> {
17
+  @override
18
+  void initState() {
19
+    super.initState();
20
+    //注册协议的手势
21
+  }
22
+
16 23
   bool isButtonEnable = true; //按钮状态  是否可点击
17 24
   String buttonText = '发送验证码'; //初始文本
18
-  int count = 5; //初始倒计时时间
25
+  int count = 60; //初始倒计时时间
19 26
   var timer; //倒计时的计时器
20 27
   TextEditingController mController = TextEditingController();
21
-  void _buttonClickListen() {
22
-    print('获取验证码按钮');
23
-    setState(() {
24
-      if (isButtonEnable) {
25
-        //当按钮可点击时
26
-        isButtonEnable = false; //按钮状态标记
27
-        _initTimer();
28
-        getSMSCaptch(handlePhones);
29
-        return null; //返回null按钮禁止点击
30
-      } else {
31
-        //当按钮不可点击时
32
-//        debugPrint('false');
33
-        return null; //返回null按钮禁止点击
34
-      }
35
-    });
36
-  }
37 28
 
38 29
   void _initTimer() {
39
-    timer = new Timer.periodic(Duration(seconds: 1), (Timer timer) {
30
+    timer = Timer.periodic(Duration(seconds: 1), (Timer timer) {
40 31
       count--;
41 32
       setState(() {
42 33
         if (count == 0) {
43 34
           timer.cancel(); //倒计时结束取消定时器
44 35
           isButtonEnable = true; //按钮可点击
45
-          count = 5; //重置时间
36
+          count = 60; //重置时间
46 37
           buttonText = '发送验证码'; //重置按钮文本
47 38
         } else {
48 39
           buttonText = '重新发送($count)'; //更新文本内容
@@ -57,6 +48,8 @@ class _RouteLogin extends State<MyRouteLogin> {
57 48
     timer = null;
58 49
     mController.dispose();
59 50
     super.dispose();
51
+
52
+    ///销毁
60 53
   }
61 54
 
62 55
 // -------------逻辑分割-------------------------------------------
@@ -81,240 +74,236 @@ class _RouteLogin extends State<MyRouteLogin> {
81 74
         print('我输入的信息:${userContent},手机号:${userContent['phones']}')
82 75
       };
83 76
 
77
+  bool _checkValue = false;
78
+  bool _newValue = false;
79
+
80
+  void _buttonClickListen() {
81
+    setState(() {
82
+      if (isButtonEnable) {
83
+        if (handlePhones != '') {
84
+          isButtonEnable = false; //按钮状态标记
85
+          _initTimer();
86
+          getSMSCaptch(handlePhones);
87
+        } else {
88
+          Fluttertoast.showToast(msg: '请正确输入手机号!');
89
+        }
90
+
91
+        print('获取验证码按钮222222');
92
+      }
93
+    });
94
+  }
95
+
84 96
   @override
85 97
   Widget build(BuildContext context) {
86 98
     return Container(
87
-
88
-        decoration: const BoxDecoration(
89
-          image: DecorationImage(
90
-            image: AssetImage("images/icon_login.png"),
91
-            fit: BoxFit.cover,
92
-          ),
99
+      width: 250,
100
+      height: 250,
101
+      decoration: const BoxDecoration(
102
+        image: DecorationImage(
103
+          image: AssetImage("images/icon_login.png"),
104
+          fit: BoxFit.cover,
93 105
         ),
94
-        child: Scaffold(
95
-            backgroundColor: Colors.transparent, //把scaffold的背景色改成透明
96
-            appBar: AppBar(
97
-              backgroundColor: Colors.transparent, //把appbar的背景色改成透明
98
-              // elevation: 0,//appbar的阴影
99
-              title: const Text('登陆'),
100
-            ),
101
-            body: Center(
102
-                child:  ListView(
103
-              // crossAxisAlignment: CrossAxisAlignment.start,
104
-              children: <Widget>[
106
+      ),
105 107
 
106
-                const Text(
107
-                  '您好!',
108
-                  style: TextStyle(
109
-                    fontWeight: FontWeight.bold,
110
-                    fontSize: 50,
111
-                  ),
108
+      child: Scaffold(
109
+        backgroundColor: Colors.transparent, //把scaffold的背景色改成透明
110
+        body: Center(
111
+          child: Column(
112
+            mainAxisAlignment: MainAxisAlignment.end,
113
+            crossAxisAlignment: CrossAxisAlignment.start,
114
+            children:[
115
+              const Text(
116
+                '您好!',
117
+                style: TextStyle(
118
+                  fontWeight: FontWeight.bold,
119
+                  fontSize: 50,
112 120
                 ),
113
-                const Text(
114
-                  '欢迎进入农户端应用!',
115
-                  style: TextStyle(
116
-                    fontWeight: FontWeight.bold,
117
-                    fontSize: 35,
118
-                  ),
121
+              ),
122
+              const Text(
123
+                '欢迎进入农户端应用!',
124
+                style: TextStyle(
125
+                  fontWeight: FontWeight.bold,
126
+                  fontSize: 35,
119 127
                 ),
128
+              ),
120 129
 
121
-                // Container(
122
-                //   // margin: EdgeInsets.fromLTRB(5,0,0,0),
123
-                //     decoration: BoxDecoration(
124
-                //         border: Border(
125
-                //             bottom: BorderSide(
126
-                //                 width: 1, color: Color(0xffe5e5e5)))),
127
-                //     child: Flex(
128
-                //       direction: Axis.horizontal,
129
-                //       children: <Widget>[
130
-                //         Expanded(
131
-                //           child: TextField(
132
-                //             autofocus: true,
133
-                //             maxLength: 11,
134
-                //             keyboardType: TextInputType.number,
135
-                //             cursorColor: Color(0xD4D4D4FF),
136
-                //             decoration: const InputDecoration(
137
-                //               contentPadding:EdgeInsets.fromLTRB(30.0, 0, 0, 0),
138
-                //               hintText: "请输入手机号",
139
-                //               prefixIcon: Icon(Icons.phone_iphone_outlined),
140
-                //               counterText: '',
141
-                //               border: OutlineInputBorder(
142
-                //                   borderSide: BorderSide.none),
143
-                //             ),
144
-                //             onChanged: (e) {
145
-                //               _handlePhone(e);
146
-                //               // phoneUser(e);
147
-                //             },
148
-                //           ),
149
-                //         ),
150
-                //         Container(
151
-                //           width: 100.0,
152
-                //           child: SizedBox(
153
-                //             child: FlatButton(
154
-                //               disabledColor:
155
-                //               Colors.grey.withOpacity(0.1), //按钮禁用时的颜色
156
-                //               disabledTextColor: Colors.white, //按钮禁用时的文本颜色
157
-                //               textColor: isButtonEnable
158
-                //                   ? Colors.white
159
-                //                   : Colors.black.withOpacity(0.2), //文本颜色
160
-                //               color: isButtonEnable
161
-                //                   ? Color(0xffff703b)
162
-                //                   : Colors.grey.withOpacity(0.1), //按钮的颜色
163
-                //               splashColor: isButtonEnable
164
-                //                   ? Colors.white.withOpacity(0.1)
165
-                //                   : Colors.transparent,
166
-                //               shape: StadiumBorder(side: BorderSide.none),
167
-                //               onPressed: () {
168
-                //                 setState(() {
169
-                //                   if (isButtonEnable) {
170
-                //                     _buttonClickListen();
171
-                //                   } else {
172
-                //                     return;
173
-                //                   }
174
-                //                 });
175
-                //               },
176
-                //               child: Text(
177
-                //                 '$buttonText',
178
-                //                 style: TextStyle(
179
-                //                   fontSize: 13,
180
-                //
181
-                //                 ),
182
-                //               ),
183
-                //             ),
184
-                //           ),
185
-                //         ),
186
-                //       ],
187
-                //     )),
188
-
189
-                Cell(
130
+              Cell(
190 131
                   // margin: EdgeInsets.symmetric(horizontal: 13.w),
191
-                  margin: const EdgeInsets.fromLTRB(13, 43, 10,0 ),
132
+                  margin: const EdgeInsets.fromLTRB(13, 43, 10, 0),
192 133
                   header: Text(
193 134
                     "+86",
194
-                    style: TextStyle(fontSize: 19.sp,),
195
-                  ),
196
-                  child: TextField(
197
-                    maxLength: 11,
198
-                      keyboardType: TextInputType.number,
199
-                      style: TextStyle(
200
-                        fontSize: 17.sp,
201
-                      ),
202
-                      decoration: const InputDecoration(
203
-                        isCollapsed: true,
204
-                        contentPadding:
205
-                            EdgeInsets.symmetric(vertical: 8, horizontal: 16),
206
-                        labelText: "请输入手机号码",
207
-                        counterText: '',//去掉计数
208
-                        border: InputBorder.none,
209
-                        floatingLabelBehavior: FloatingLabelBehavior.never,
210
-                      ),
211
-                      onChanged: (e) {
212
-                                _handlePhone(e);
213
-                              },
214
-                  ),
215
-                  footer: ElevatedButton(
216
-                    onPressed: () => {
217
-                      setState(() {
218
-                        if (isButtonEnable) {
219
-                          _buttonClickListen();
220
-                        } else {
221
-                          return;
222
-                        }
223
-                      })
224
-                    },
225
-                    child: Text(
226
-                      '$buttonText',
227
-                      style: TextStyle(fontSize: 15.sp),
228
-                    ),
229
-                    style: ElevatedButton.styleFrom(
230
-                        primary: const Color(0xFFFF703B),
231
-                        elevation: 0,
232
-                        shape: const RoundedRectangleBorder(
233
-                            borderRadius:
234
-                                BorderRadius.all(Radius.circular(10)))),
235
-                  ),
236
-                ),
237
-//          --------------FractionalOffset API--------------
238
-//                 FractionalOffset(0.0, 0.0):顶部左边
239
-//                 FractionalOffset(0.5, 0.0):顶部中间
240
-//                 FractionalOffset(1.0, 0.0):顶部右边
241
-//                 FractionalOffset(0.0, 0.5):中部左边
242
-//                 FractionalOffset(0.5, 0.5):中部中间
243
-//                 FractionalOffset(1.0, 0.5):中部右边
244
-//                 FractionalOffset(0.0, 1.0):底部左边
245
-//                 FractionalOffset(0.5, 1.0):底部中间
246
-//                 FractionalOffset(1.0, 1.0):底部右边
247
-
248
-                Cell(
249
-                  // margin: EdgeInsets.symmetric(horizontal: 13.w),
250
-                  margin: const EdgeInsets.fromLTRB(13, 16, 10,0 ),
251
-
252
-                  header:        Align(
253
-                    alignment: FractionalOffset(0.1, 0.5),
254
-                    child: Image.asset(
255
-                      'images/phoneCode.png',
256
-                      width: 20,
257
-                      height: 20,
135
+                    style: TextStyle(
136
+                      fontSize: 19.sp,
258 137
                     ),
259 138
                   ),
260
-
261 139
                   child: TextField(
140
+                    maxLength: 11,
262 141
                     keyboardType: TextInputType.number,
263 142
                     style: TextStyle(
264 143
                       fontSize: 17.sp,
265
-
266 144
                     ),
267 145
                     decoration: const InputDecoration(
268 146
                       isCollapsed: true,
269
-
270 147
                       contentPadding:
271
-                      EdgeInsets.symmetric(vertical: 8, horizontal: 16),
272
-                      labelText: "请输入验证码",
148
+                          EdgeInsets.symmetric(vertical: 8, horizontal: 16),
149
+                      labelText: "请输入手机号码",
150
+                      counterText: '', //去掉计数
273 151
                       border: InputBorder.none,
274 152
                       floatingLabelBehavior: FloatingLabelBehavior.never,
275 153
                     ),
276 154
                     onChanged: (e) {
277
-                      _handleCode(e);
155
+                      _handlePhone(e);
278 156
                     },
279 157
                   ),
158
+                  footer: SizedBox(
159
+                    width: 300.w,
160
+                    child: ElevatedButton(
161
+                      onPressed: () => {
162
+                        setState(() {
163
+                          // _buttonClickListen();
164
+                          setState(() {
165
+                            if (isButtonEnable) {
166
+                              if (handlePhones != '') {
167
+                                isButtonEnable = false; //按钮状态标记
168
+                                _initTimer();
169
+                                getSMSCaptch(handlePhones);
170
+                              } else {
171
+                                Fluttertoast.showToast(msg: '请正确输入手机号!');
172
+                              }
280 173
 
281
-                ),
174
+                              print('获取验证码按钮222222');
175
+                            }
176
+                          });
282 177
 
178
+                        })
179
+                      },
180
+                      child: Text(
181
+                        '$buttonText',
182
+                        style: TextStyle(
183
+                          fontSize: 15.sp,
184
+                        ),
185
+                      ),
186
+                      style: ButtonStyle(
187
+                        backgroundColor: isButtonEnable
188
+                            ? MaterialStateProperty.all(const Color(0xFFFF703B))
189
+                            : MaterialStateProperty.all(
190
+                                const Color(0xFFCBCBCB)),
191
+                        shape: MaterialStateProperty.all(
192
+                            const RoundedRectangleBorder(
193
+                                borderRadius:
194
+                                    BorderRadius.all(Radius.circular(10)))),
195
+                      ),
196
+                    ),
197
+                  )),
198
+//          --------------FractionalOffset API--------------
283 199
 
200
+              Cell(
201
+                // margin: EdgeInsets.symmetric(horizontal: 13.w),
202
+                margin: const EdgeInsets.fromLTRB(13, 16, 10, 0),
284 203
 
204
+                header: Align(
205
+                  alignment: FractionalOffset(0.1, 0.5),
206
+                  child: Image.asset(
207
+                    'images/phoneCode.png',
208
+                    width: 20,
209
+                    height: 20,
210
+                  ),
211
+                ),
285 212
 
286
-                // TextField(
287
-                //   style: TextStyle(
288
-                //     fontSize: 17.sp,
289
-                //   ),
290
-                //   keyboardType: TextInputType.number,
291
-                //   cursorColor: Color(0xD4D4D4FF),
292
-                //   decoration: const InputDecoration(
293
-                //       contentPadding:
294
-                //       EdgeInsets.symmetric(vertical: 8, horizontal: 16),
295
-                //       labelText: "请输入验证码",
296
-                //       prefixIcon: Icon(Icons.beenhere)),
297
-                //   onChanged: (e) {
298
-                //     _handleCode(e);
299
-                //   },
300
-                // ),
301
-                // 登录按钮
302
-                 Center(
303
-                    child: DefaultButton(
304
-                      margin: const EdgeInsets.fromLTRB(0, 30.0, 0, 0), //可选配置,自定义控件中有默认配置
305
-                      text: "登陆",
306
-                      width: 90.0,
307
-                      height: 50.0,
308
-                      fontSize: 20.0,
309
-                      backColor: const Color(0xffff703b),
310
-                      color: Colors.white,
311
-                      onPressed: () {
312
-                      },
313
-                    ),
314
-                  ) ,
213
+                child: TextField(
214
+                  keyboardType: TextInputType.number,
215
+                  style: TextStyle(
216
+                    fontSize: 17.sp,
217
+                  ),
218
+                  decoration: const InputDecoration(
219
+                    isCollapsed: true,
220
+                    contentPadding:
221
+                        EdgeInsets.symmetric(vertical: 8, horizontal: 16),
222
+                    labelText: "请输入验证码",
223
+                    border: InputBorder.none,
224
+                    floatingLabelBehavior: FloatingLabelBehavior.never,
225
+                  ),
226
+                  onChanged: (e) {
227
+                    _handleCode(e);
228
+                  },
229
+                ),
230
+              ),
315 231
 
232
+              Container(
233
+                height: 350.h,
234
+                alignment: Alignment.bottomCenter,
235
+                child: SizedBox(
236
+                  width: 315.w,
237
+                  height: 49.h,
238
+                  child: ElevatedButton(
239
+                    onPressed: () {
240
+                      if(handleCodes==''||handlePhones==''){
241
+                        Fluttertoast.showToast(msg: '请输入验证码或手机号!');
242
+                      }else{
243
+                        if(_newValue){
244
+                          print('已同意协议');
245
+                        }else{
246
+                          Fluttertoast.showToast(msg: '请阅读并同意相关隐私政策!');
247
+                        }
248
+                      }
249
+                    },
250
+                    child: const Text(
251
+                      "登陆",
252
+                      style: TextStyle(
253
+                          fontSize: 18,
254
+                          color: Colors.white,
255
+                          fontWeight: FontWeight.bold),
256
+                    ),
257
+                    style: ButtonStyle(
258
+                      backgroundColor:
259
+                          MaterialStateProperty.all(const Color(0xFFFF703B)),
260
+                      shape: MaterialStateProperty.all(
261
+                          const RoundedRectangleBorder(
262
+                              borderRadius:
263
+                                  BorderRadius.all(Radius.circular(24.4)))),
264
+                    ),
265
+                  ),
266
+                ),
267
+              ),
316 268
 
317
-              ],
318
-            ))));
269
+              Padding(
270
+                  padding: EdgeInsets.fromLTRB(10.0, 10, 10.0, 10),
271
+                  child: Row(
272
+                    children: <Widget>[
273
+                      Radio<bool>(
274
+                          value: true,
275
+                          activeColor: Color(0xFFFF703B),
276
+                          groupValue: _newValue,
277
+                          onChanged: (value) {
278
+                            setState(() {
279
+                              _newValue = value!;
280
+                            });
281
+                          }),
282
+                      RichText(
283
+                        text: TextSpan(children: <InlineSpan>[
284
+                          TextSpan(
285
+                              text: '请认真查看',
286
+                              style: TextStyle(color: Color(0xff2a2a2a))),
287
+                          TextSpan(
288
+                            text: '文本协议/隐私政策,',
289
+                            style: TextStyle(color: Color(0xffce3800)),
290
+                            recognizer:
291
+                                TapGestureRecognizer() //踩坑。。。recognizer 是手势交互 除了我现在些的是 点击交互,其他一般都是抽象类。
292
+                                  ..onTap = () {
293
+                                    print('阅读已同意!!!');
294
+                                  },
295
+                          ),
296
+                          TextSpan(
297
+                              text: '确认之后选择此项',
298
+                              style: TextStyle(color: Color(0xff2a2a2a))),
299
+                        ]),
300
+                      ),
301
+                    ],
302
+                  )),
303
+            ],
304
+          ),
305
+        ),
306
+      ),
307
+    );
319 308
   }
320 309
 }

+ 6
- 6
lib/services/user.dart Ver arquivo

@@ -6,15 +6,15 @@ import 'package:fluttertoast/fluttertoast.dart';
6 6
 
7 7
 
8 8
 Future getSMSCaptch(String phone) async {
9
-  return request('/sms-captcha', options: Options(method: 'POST'), queryParameters: { 'phone': phone }).catchError((error) {
10
-    // var e = error.error ;
11
-    // var message = e['message'];
9
+  return request('/sms-captcha', options: Options(method: 'POST'), queryParameters: { 'phone': phone })
10
+      .then((value) {
12 11
     Fluttertoast.showToast(
13
-      msg: error.error['message']
12
+        msg: '验证码发送成功!'
14 13
     );
15
-  }).then((value) {
14
+  }).catchError((error) {
15
+
16 16
     Fluttertoast.showToast(
17
-        msg: '验证码发送成功!'
17
+      msg: error.error['message']
18 18
     );
19 19
   });
20 20
 }

+ 1
- 1
lib/widgets/Cell.dart Ver arquivo

@@ -43,7 +43,7 @@ class Cell extends StatelessWidget {
43 43
           ),
44 44
           Expanded(child: child,),
45 45
           if (null != footer) ConstrainedBox (
46
-            constraints: BoxConstraints(maxWidth: 94.w),
46
+            constraints: BoxConstraints(maxWidth: 100.w),
47 47
             child: footer,
48 48
           )
49 49
         ],

+ 8
- 0
pubspec.yaml Ver arquivo

@@ -66,6 +66,14 @@ flutter:
66 66
   assets:
67 67
     - images/icon_login.png
68 68
     - images/phoneCode.png
69
+    - images/HomesNOImgaes.png
70
+    - images/HomesOFFImgaes.png
71
+    - images/MineNOImgaes.png
72
+    - images/MineOFFImgaes.png
73
+    - images/newsOFFImages.png
74
+    - images/newsONImages.png
75
+    - images/OrdersNOImgaes.png
76
+    - images/OrdersOFFImgaes.png
69 77
 
70 78
   # An image asset can refer to one or more resolution-specific "variants", see
71 79
   # https://flutter.dev/assets-and-images/#resolution-aware.