张延森 3 年之前
父節點
當前提交
963f91ca9d

images/icons/ListBack.png → images/icons/nullDataImg.png 查看文件


二進制
images/icons/search.png 查看文件


+ 28
- 0
lib/models/entities/banner.dart 查看文件

@@ -0,0 +1,28 @@
1
+class banner {
2
+  String? bannerId;
3
+  String? title;
4
+  String? thumb;
5
+  String? position;
6
+  num? sortNo;
7
+  num? status;
8
+  String? createDat;
9
+  banner();
10
+
11
+  banner.fromJson(Map<String, dynamic> json)
12
+      : bannerId = json["bannerId"],
13
+        title = json["title"],
14
+        thumb = json["thumb"],
15
+        position = json["position"],
16
+        sortNo = json["sortNo"],
17
+        status = json["status"],
18
+        createDat = json["createDat"];
19
+  Map<String, dynamic> toJson() => {
20
+        "bannerId": bannerId,
21
+        "title": title,
22
+        "thumb": thumb,
23
+        "position": position,
24
+        "sortNo": sortNo,
25
+        "status": status,
26
+        "createDat": createDat,
27
+      };
28
+}

+ 64
- 91
lib/pages/MoreCars/index.dart 查看文件

@@ -1,12 +1,11 @@
1
-
2 1
 import 'package:flutter/material.dart';
3 2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4 4
 
5 5
 import '../../widgets/CarsCard.dart';
6 6
 import '../../widgets/Search.dart';
7 7
 import '../TabBar/widgets/home/widgets/headers.dart';
8 8
 
9
-
10 9
 class MoreCars extends StatefulWidget {
11 10
   const MoreCars({Key? key}) : super(key: key);
12 11
 
@@ -14,115 +13,89 @@ class MoreCars extends StatefulWidget {
14 13
   State<MoreCars> createState() => _MoreCarsState();
15 14
 }
16 15
 
17
-class _MoreCarsState extends State<MoreCars> with TickerProviderStateMixin  {
18
-
19
-  late TabController _controller = TabController(length: tabText.length, vsync: this);
20
-   List<String> tabText= [
21
-     '全部',
22
-     '播种机',
23
-     '收割机',
24
-     '挺长名字的农机选项分类',
16
+class _MoreCarsState extends State<MoreCars> with TickerProviderStateMixin {
17
+  late TabController _controller =
18
+      TabController(length: tabText.length, vsync: this);
19
+  List<String> tabText = [
20
+    '全部',
21
+    '播种机',
22
+    '收割机',
23
+    '挺长名字的农机选项分类',
25 24
   ];
26 25
 
27
-
28
-
29 26
   @override
30 27
   void initState() {
31 28
     // TODO: implement initState
32 29
     super.initState();
33 30
   }
31
+
34 32
   @override
35 33
   Widget build(BuildContext context) {
36 34
     // _controller=TabController(length: tabText.length, vsync: this);
37 35
     return Scaffold(
38
-      resizeToAvoidBottomInset: false,
39
-      appBar: AppBar(
40
-        elevation: 0,
41
-        centerTitle: true,
42
-        backgroundColor: Colors.white,
43
-        title:Text(
44
-          '更多',
45
-          style: TextStyle(
46
-              color: Colors.black,
47
-              fontSize: 17.sp,
48
-              letterSpacing: 2,
49
-              fontWeight: FontWeight.bold),
36
+        resizeToAvoidBottomInset: false,
37
+        appBar: AppBar(
38
+          elevation: 0,
39
+          centerTitle: true,
40
+          backgroundColor: Colors.white,
41
+          title: Text(
42
+            '更多',
43
+            style: TextStyle(
44
+                color: Colors.black,
45
+                fontSize: 17.sp,
46
+                letterSpacing: 2,
47
+                fontWeight: FontWeight.bold),
48
+          ),
50 49
         ),
51 50
 
52
-      ),
53
-      body: ListView(
54
-          children: [Column(
55
-          children: [
56
-            Container(
57
-              padding: EdgeInsets.fromLTRB(20, 15, 20, 15),
58 51
 
59
-              decoration: BoxDecoration(
60
-                color: Colors.white
61
-              ),
62
-              // child:Search(),
63
-              child:          Container(
64
-                  height: 32.w,
65
-                  decoration: const BoxDecoration(
66
-                      color: Colors.white
67
-                  ),
68
-                  child: GestureDetector(
69
-                      onTap: (){
70
-                        print('点击了搜索');
71
-                      },
72
-                      child: Container(
73
-                        decoration: const BoxDecoration(
74
-                          // color: Colors.red,
75
-                          color: Color(0x30cccccc),
76
-                          borderRadius: BorderRadius.all(Radius.circular(25)),
77
-                        ),
78
-                        child: Row(
79
-                          children: [
80
-                            Padding(padding: EdgeInsets.fromLTRB(15, 0, 5, 0),
81
-                              child: Icon(Icons.search,size: 19,color:Color(0xff666666) ,),
82
-                            ),
83
-                            Text('请输入关键字查询',style: TextStyle(color: Color(0xff666666),fontSize: 14),)
84
-                          ],
85
-                        ),
86
-                      )
87
-                    // Search(),
52
+      body: Container(
53
+        decoration: BoxDecoration(
54
+            color: Colors.white
55
+        ),
56
+        child:       ListView(
57
+            children: [Column(
58
+              children: [
59
+                Container(
60
+                  padding: EdgeInsets.fromLTRB(0, 15, 0, 15),
61
+                  width: 350.w,
62
+                  child: TypeHeader(type: false,),
63
+                ),
64
+
65
+                TabBar(
66
+                  labelStyle: TextStyle(fontSize: ScreenUtil().setSp(19),fontWeight: FontWeight.bold), //选中的样式
67
+                  unselectedLabelStyle: TextStyle(fontSize:ScreenUtil().setSp(16)), //未选中的样式
68
+                  controller: _controller,
69
+                  isScrollable: true, //可滚动
70
+                  indicatorColor: Colors.black, //指示器的颜色
71
+                  labelColor: Colors.black, //选中文字颜色
72
+                  unselectedLabelColor: Color(0xffadadad),
73
+                  // indicatorSize: TabBarIndicatorSize.label, //指示器与文字等宽
74
+                  tabs: tabText.map((e) => Tab(text: e)).toList(),
75
+                  onTap: (int i) {
76
+                    print('当前+${i}');
77
+                  },
78
+
79
+                ),
80
+                Container(
81
+                  child: Column(
82
+                    children: [
83
+                      CarsCard(),
84
+                      CarsCard(),
85
+                      CarsCard(),
86
+                      CarsCard(),
87
+                    ],
88 88
                   )
89
-              ),
90
-            ),
91
-            
92
-            TabBar(
93
-              labelStyle: TextStyle(fontSize: ScreenUtil().setSp(19),fontWeight: FontWeight.bold), //选中的样式
94
-              unselectedLabelStyle: TextStyle(fontSize:ScreenUtil().setSp(16)), //未选中的样式
95
-              controller: _controller,
96
-              isScrollable: true, //可滚动
97
-              indicatorColor: Colors.black, //指示器的颜色
98
-              labelColor: Colors.black, //选中文字颜色
99
-              unselectedLabelColor: Color(0xffadadad),
100
-              // indicatorSize: TabBarIndicatorSize.label, //指示器与文字等宽
101
-              tabs: tabText.map((e) => Tab(text: e)).toList(),
102
-              onTap: (int i) {
103
-                print('当前+${i}');
104
-              },
105
-
106
-            ),
107
-            Container(
108
-              child: Column(
109
-                children: [
110
-                  CarsCard(),
111
-                  CarsCard(),
112
-                  CarsCard(),
113
-                  CarsCard(),
114
-                ],
115
-              )
116
-              ,
117
-            )
89
+                  ,
90
+                )
118 91
 
119 92
 
120
-          ],
121
-        )]
93
+              ],
94
+            )]
122 95
 
96
+        ),
123 97
       )
124 98
 
125 99
     );
126 100
   }
127 101
 }
128
-

+ 19
- 13
lib/pages/OrderConfirmation/index.dart 查看文件

@@ -1,8 +1,8 @@
1
-import 'package:flutter/cupertino.dart';
2 1
 import 'package:flutter/material.dart';
3 2
 import 'package:flutter/services.dart';
4 3
 import 'package:flutter_screenutil/flutter_screenutil.dart';
5 4
 import 'package:get/get.dart';
5
+import 'package:get_storage/get_storage.dart';
6 6
 import 'package:intl/intl.dart';
7 7
 
8 8
 class OrderConfirmation extends StatefulWidget {
@@ -19,8 +19,15 @@ class _OrderConfirmationState extends State<OrderConfirmation> {
19 19
 
20 20
   var selectDate; //选择的时间
21 21
   var workingArea;
22
-
23
-
22
+  String address = '请选择详细地址';
23
+  @override
24
+  void initState() {
25
+    super.initState();
26
+    //到底哪里错了 唉
27
+    // if (GetStorage().read("address") != null) {
28
+    //   address = GetStorage().read("address").address;
29
+    // }
30
+  }
24 31
 //  20:59:59
25 32
 
26 33
   @override
@@ -76,9 +83,9 @@ class _OrderConfirmationState extends State<OrderConfirmation> {
76 83
                 floatingLabelBehavior: FloatingLabelBehavior.never,
77 84
                 hintText: "请输入具体面积(公顷)",
78 85
               ),
79
-              onChanged: (e){
86
+              onChanged: (e) {
80 87
                 setState(() {
81
-                  workingArea=e;
88
+                  workingArea = e;
82 89
                 });
83 90
               },
84 91
               // 校验用户名
@@ -173,11 +180,14 @@ class _OrderConfirmationState extends State<OrderConfirmation> {
173 180
                   Padding(
174 181
                       padding: EdgeInsets.fromLTRB(10, 0, 0, 0),
175 182
                       child: GestureDetector(
176
-                        onTap: () {},
183
+                        onTap: () {
184
+                          Get.toNamed('/addressList',
185
+                              arguments: {'isBack': true});
186
+                        },
177 187
                         child: Container(
178 188
                           width: 290.w,
179 189
                           child: Text(
180
-                            '请选择详细地址',
190
+                            address,
181 191
                             softWrap: true,
182 192
                             maxLines: 1,
183 193
                             textAlign: TextAlign.left,
@@ -189,7 +199,6 @@ class _OrderConfirmationState extends State<OrderConfirmation> {
189 199
               ),
190 200
             ),
191 201
 
192
-            // 登录按钮
193 202
             Spacer(),
194 203
             Container(
195 204
               alignment: Alignment.bottomCenter,
@@ -199,9 +208,10 @@ class _OrderConfirmationState extends State<OrderConfirmation> {
199 208
                 child: ElevatedButton(
200 209
                   onPressed: () {
201 210
                     if ((_formKey.currentState as FormState).validate()) {
202
-                      var a={selectDate,workingArea};
211
+                      var a = {selectDate, workingArea};
203 212
                       print('我确定了$a');
204 213
                       //验证通过提交数据
214
+                      Get.toNamed('/orderPageInfo');
205 215
                     }
206 216
                   },
207 217
                   child: const Text(
@@ -260,7 +270,3 @@ class _OrderConfirmationState extends State<OrderConfirmation> {
260 270
     );
261 271
   }
262 272
 }
263
-
264
-
265
-
266
-

+ 74
- 66
lib/pages/TabBar/widgets/home/index.dart 查看文件

@@ -4,11 +4,12 @@ import 'package:flutter/material.dart';
4 4
 import 'package:flutter_screenutil/flutter_screenutil.dart';
5 5
 import 'package:get/get.dart';
6 6
 import 'package:get/get_core/src/get_main.dart';
7
+import '../../../../models/entities/banner.dart';
8
+import '../../../../services/homeAPI.dart';
7 9
 import '../../../../widgets/CarsCard.dart';
8 10
 import '../../../../widgets/Search.dart';
9 11
 import '../../../MoreCars/index.dart';
10 12
 
11
-
12 13
 class HomePage extends StatefulWidget {
13 14
   const HomePage({Key? key}) : super(key: key);
14 15
 
@@ -18,14 +19,19 @@ class HomePage extends StatefulWidget {
18 19
 
19 20
 class _HomePageState extends State<HomePage> {
20 21
   final CarouselController _controller = CarouselController();
21
-  final List<String> imgList = [
22
-    'https://images.unsplash.com/photo-1520342868574-5fa3804e551c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=6ff92caffcdd63681a35134a6770ed3b&auto=format&fit=crop&w=1951&q=80',
23
-    'https://images.unsplash.com/photo-1522205408450-add114ad53fe?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=368f45b0888aeb0b7b08e3a1084d3ede&auto=format&fit=crop&w=1950&q=80',
24
-    'https://images.unsplash.com/photo-1519125323398-675f0ddb6308?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=94a1e718d89ca60a6337a6008341ca50&auto=format&fit=crop&w=1950&q=80',
25
-    'https://images.unsplash.com/photo-1523205771623-e0faa4d2813d?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=89719a0d55dd05e2deae4120227e6efc&auto=format&fit=crop&w=1953&q=80',
26
-    'https://images.unsplash.com/photo-1508704019882-f9cf40e475b4?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=8c6e5e3aba713b17aa1fe71ab4f0ae5b&auto=format&fit=crop&w=1352&q=80',
27
-    'https://images.unsplash.com/photo-1519985176271-adb1088fa94c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=a0c8d632e977f94e5d312d9893258f59&auto=format&fit=crop&w=1355&q=80'
28
-  ];
22
+  List<banner> BannerList = [];
23
+
24
+  @override
25
+  void initState() {
26
+    super.initState();
27
+    getHomeBanner('banner').then((value) {
28
+      setState(() {
29
+        value.forEach((item) {
30
+          BannerList.add(banner.fromJson(item));
31
+        });
32
+      });
33
+    });
34
+  }
29 35
 
30 36
   @override
31 37
   Widget build(BuildContext context) {
@@ -34,77 +40,79 @@ class _HomePageState extends State<HomePage> {
34 40
       padding: EdgeInsets.fromLTRB(15.w, 0, 15.w, 0),
35 41
       child: ListView(
36 42
         children: [
37
-          headers(),
43
+          Container(
44
+            width: 20.w,
45
+            child: TypeHeader(
46
+              type: true,
47
+            ),
48
+          ),
38 49
           Container(
39 50
             margin: EdgeInsets.fromLTRB(0, 15, 0, 0),
40
-            child: CarouselSlider(
41
-              //API  https://pub.dev/documentation/carousel_slider/latest/carousel_options/CarouselOptions-class.html
42
-              items:imgList
43
-                  .map((item) => Container(
44
-                child: Center(
45
-                    child:
46
-                    Image.network(item, fit: BoxFit.cover, width: 350.w)),
47
-              ))
48
-                  .toList(),
51
+            child:
52
+                // Text('asdasdas')
53
+                CarouselSlider(
54
+              items: BannerList.map((item) => Container(
55
+                    child: Center(
56
+                        child: Image.network(item.thumb.toString(),
57
+                            fit: BoxFit.cover, width: 350.w)),
58
+                  )).toList(),
49 59
               options: CarouselOptions(
50 60
                 autoPlay: true,
51
-                enlargeCenterPage: false,//图片中心放大
52
-                viewportFraction: 1,//每个页面应占据的视口部分。默认为 0.8,这意味着每个页面填充 80% 的轮播。
61
+                enlargeCenterPage: false, //图片中心放大
62
+                viewportFraction: 1, //每个页面应占据的视口部分。默认为 0.8,这意味着每个页面填充 80% 的轮播。
53 63
                 // aspectRatio: 1.6,//纵横比
54 64
                 height: 214.w,
55
-                initialPage: 1,//初始页
65
+                initialPage: 1, //初始页
56 66
               ),
57 67
             ),
58 68
           ),
59
-          
60
-
61 69
           Container(
62
-            margin: EdgeInsets.fromLTRB(0, 20, 0, 20),
63
-            child: Column(
64
-              children: [
65
-                Row(
66
-                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
67
-                  children: [
68
-                    Container(
69
-                      child: Row(
70
-                        children: [
71
-                          Padding(padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
72
-                            child:Image(image: AssetImage('images/icons/carsListImga.png'),fit: BoxFit.cover,width: 20.w,),
73
-                          ),
74
-                          Text('农机列表',
75
-                            style: TextStyle(
76
-                                color: Color(0xff222222),
77
-                                fontSize: 20.sp,
78
-                                fontWeight: FontWeight.bold
70
+              margin: EdgeInsets.fromLTRB(0, 20, 0, 20),
71
+              child: Column(
72
+                children: [
73
+                  Row(
74
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
75
+                    children: [
76
+                      Container(
77
+                        child: Row(
78
+                          children: [
79
+                            Padding(
80
+                              padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
81
+                              child: Image(
82
+                                image:
83
+                                    AssetImage('images/icons/carsListImga.png'),
84
+                                fit: BoxFit.cover,
85
+                                width: 20.w,
86
+                              ),
79 87
                             ),
80
-                          )
81
-                        ],
88
+                            Text(
89
+                              '农机列表',
90
+                              style: TextStyle(
91
+                                  color: Color(0xff222222),
92
+                                  fontSize: 20.sp,
93
+                                  fontWeight: FontWeight.bold),
94
+                            )
95
+                          ],
96
+                        ),
82 97
                       ),
83
-                    ),
84
-                    Container(
85
-                      child:GestureDetector(
86
-                        child:  Text('更多 >>'),
87
-                        onTap: (){
88
-                          print('点我进入农机搜索/更多页');
89
-                          Get.to(MoreCars());
90
-                        },
91
-                      ),
92
-                    )
93
-
94
-                  ],
95
-                ),
96
-                CarsCard(),
97
-                CarsCard(),
98
-                CarsCard(),
99
-              ],
100
-            )
101
-
102
-          ),
103
-
98
+                      Container(
99
+                        child: GestureDetector(
100
+                          child: Text('更多 >>'),
101
+                          onTap: () {
102
+                            print('点我进入农机搜索/更多页');
103
+                            Get.to(MoreCars());
104
+                          },
105
+                        ),
106
+                      )
107
+                    ],
108
+                  ),
109
+                  CarsCard(),
110
+                  CarsCard(),
111
+                  CarsCard(),
112
+                ],
113
+              )),
104 114
         ],
105 115
       ),
106
-
107
-
108 116
     );
109 117
   }
110 118
 }

+ 95
- 58
lib/pages/TabBar/widgets/home/widgets/headers.dart 查看文件

@@ -1,73 +1,110 @@
1 1
 import 'package:flutter/material.dart';
2 2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
3 4
 
4 5
 
5
-class headers extends StatelessWidget {
6
-  const headers({Key? key}) : super(key: key);
6
+class TypeHeader extends StatefulWidget {
7
+  TypeHeader({Key? key, required this.type}) : super(key: key);
8
+
9
+  final bool type;
7 10
 
8 11
   @override
9
-  Widget build(BuildContext context) {
10
-    return Container(
11
-      child:           Row(
12
-        children: [
13
-          Container(
14
-            height: 32.w,
15
-            decoration: BoxDecoration(
16
-                color: Colors.white
17
-            ),
18
-            child: Row(
19
-              children: [
20
-                Image(
21
-                  image: AssetImage('images/gpsImgae.png'),
22
-                  fit: BoxFit.cover,
23
-                  width: 14.w,
24
-                  height: 17.h,
25
-                ),
26
-                Padding(padding: EdgeInsets.fromLTRB(5, 0, 0, 0),
27
-                  child: Text('邓州市',
28
-                    style: TextStyle(
29
-                      color: Color(0xff202020),
30
-                      fontSize: 16.sp,
31
-                      fontWeight: FontWeight.bold,
12
+  State<TypeHeader> createState() => _TypeHeaderState();
13
+}
14
+
15
+class _TypeHeaderState extends State<TypeHeader> {
16
+  @override
17
+  Widget build (BuildContext context) {
18
+    if (widget.type) {
19
+      return Container(
20
+        child: Row(
21
+          children: [
22
+            Container(
23
+              height: 32.w,
24
+              decoration: BoxDecoration(color: Colors.white),
25
+              child: Row(
26
+                children: [
27
+                  Image(
28
+                    image: AssetImage('images/gpsImgae.png'),
29
+                    fit: BoxFit.cover,
30
+                    width: 14.w,
31
+                    height: 17.h,
32
+                  ),
33
+                  Padding(
34
+                    padding: EdgeInsets.fromLTRB(5, 0, 0, 0),
35
+                    child: Text(
36
+                      '邓州市',
37
+                      style: TextStyle(
38
+                        color: Color(0xff202020),
39
+                        fontSize: 16.sp,
40
+                        fontWeight: FontWeight.bold,
41
+                      ),
32 42
                     ),
33 43
                   ),
34
-                ),
35
-                const Icon(Icons.arrow_drop_down)
36
-              ],
37
-
44
+        Container(
45
+          padding: EdgeInsets.fromLTRB(0, 0, 10, 0),
46
+          child: Icon(Icons.arrow_drop_down),
47
+        ),
48
+                  _initWidget(),
49
+                ],
50
+              ),
38 51
             ),
39
-          ),
40
-          Container(
41
-              padding: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
42
-              width: 260.w,
43
-              height: 32.w,
52
+          ],
53
+        ),
54
+      );
55
+    } else {
56
+      return _initWidget();
57
+
58
+    }
59
+
60
+
61
+  }
62
+}
63
+//
64
+
65
+
66
+class _initWidget extends StatelessWidget {
67
+  const _initWidget({Key? key}) : super(key: key);
68
+
69
+  @override
70
+  Widget build(BuildContext context) {
71
+    return Container(
72
+        width: 255.w,
73
+        height: 32.w,
74
+        decoration: const BoxDecoration(color: Colors.white),
75
+        child: GestureDetector(
76
+            onTap: () {
77
+              print('点击了搜索');
78
+              Get.toNamed('/searchPage');
79
+
80
+            },
81
+            child: Container(
44 82
               decoration: const BoxDecoration(
45
-                  color: Colors.white
83
+                // color: Colors.red,
84
+                color: Color(0x30cccccc),
85
+                borderRadius: BorderRadius.all(Radius.circular(25)),
46 86
               ),
47
-              child: GestureDetector(
48
-                  onTap: (){
49
-                    print('点击了搜索');
50
-                  },
51
-                  child: Container(
52
-                    decoration: const BoxDecoration(
53
-                      // color: Colors.red,
54
-                      color: Color(0x30cccccc),
55
-                      borderRadius: BorderRadius.all(Radius.circular(25)),
56
-                    ),
57
-                    child: Row(
58
-                      children: [
59
-                        Padding(padding: EdgeInsets.fromLTRB(15, 0, 5, 0),
60
-                          child: Icon(Icons.search,size: 19,color:Color(0xff666666) ,),
61
-                        ),
62
-                        Text('请输入关键字查询',style: TextStyle(color: Color(0xff666666),fontSize: 14),)
63
-                      ],
87
+              child: Row(
88
+                children: [
89
+                  Padding(
90
+                    padding: EdgeInsets.fromLTRB(15, 0, 5, 0),
91
+                    child: Icon(
92
+                      Icons.search,
93
+                      size: 19,
94
+                      color: Color(0xff666666),
64 95
                     ),
96
+                  ),
97
+                  Text(
98
+                    '请输入关键字查询',
99
+                    style: TextStyle(color: Color(0xff666666), fontSize: 14),
65 100
                   )
66
-                // Search(),
67
-              )
68
-          )
69
-        ],
70
-      ),
71
-    );
101
+                ],
102
+              ),
103
+            )
104
+          // Search(),
105
+        ));
106
+
72 107
   }
73 108
 }
109
+
110
+

+ 42
- 24
lib/pages/addressList/index.dart 查看文件

@@ -5,7 +5,7 @@ import 'package:flutter/material.dart';
5 5
 import 'package:flutter_screenutil/flutter_screenutil.dart';
6 6
 import 'package:fluttertoast/fluttertoast.dart';
7 7
 import 'package:get/get.dart';
8
-
8
+import 'package:get_storage/get_storage.dart';
9 9
 
10 10
 class AddressList extends StatefulWidget {
11 11
   const AddressList({Key? key}) : super(key: key);
@@ -15,6 +15,15 @@ class AddressList extends StatefulWidget {
15 15
 }
16 16
 
17 17
 class _AddressList extends State<AddressList> {
18
+  bool isBack = false;
19
+
20
+  @override
21
+  void initState() {
22
+    super.initState();
23
+    if (Get.arguments != null) {
24
+      isBack = Get.arguments['isBack'];
25
+    }
26
+  }
18 27
 
19 28
   List<Address> addressList = [
20 29
     Address.fromJson({'address': '777', 'isDefault': false}),
@@ -31,31 +40,29 @@ class _AddressList extends State<AddressList> {
31 40
       addressList[index].isDefault = true;
32 41
     });
33 42
   }
34
-  void onDelete(index){
43
+
44
+  void onDelete(index) {
35 45
     showDialog(
36 46
         context: context,
37 47
         builder: (context) {
38
-          return AlertDialog(
39
-              content: Text("您确定要删除此地址吗?"),
40
-              actions: <Widget>[
41
-                TextButton(
42
-                  child: Text("取消"),
43
-                  onPressed: () {
44
-                    print("取消");
45
-                    Navigator.pop(context, 'Cancle');
46
-                  },
47
-                ),
48
-                TextButton(
49
-                    child: Text("确定"),
50
-                    onPressed: () {
51
-                      // setState(() {
52
-                      //   addressList.remove(addressList[e]);
53
-                      // });
54
-                      Navigator.pop(context, "Ok");
55
-                      Fluttertoast.showToast(
56
-                          msg: '删除成功!');
57
-                    })
58
-              ]);
48
+          return AlertDialog(content: Text("您确定要删除此地址吗?"), actions: <Widget>[
49
+            TextButton(
50
+              child: Text("取消"),
51
+              onPressed: () {
52
+                print("取消");
53
+                Navigator.pop(context, 'Cancle');
54
+              },
55
+            ),
56
+            TextButton(
57
+                child: Text("确定"),
58
+                onPressed: () {
59
+                  // setState(() {
60
+                  //   addressList.remove(addressList[e]);
61
+                  // });
62
+                  Navigator.pop(context, "Ok");
63
+                  Fluttertoast.showToast(msg: '删除成功!');
64
+                })
65
+          ]);
59 66
         });
60 67
   }
61 68
 
@@ -91,15 +98,26 @@ class _AddressList extends State<AddressList> {
91 98
                           (e) => AddressCard(
92 99
                             No: e + 1,
93 100
                             item: addressList[e],
101
+                            isBack: isBack,
94 102
                             onChange: () {
95 103
                               onChange(e);
96 104
                             },
97 105
                             onEdit: () {
98
-                              Get.toNamed('/addAddress',arguments: {'item':addressList[e]});
106
+                              Get.toNamed('/addAddress',
107
+                                  arguments: {'item': addressList[e]});
99 108
                             },
100 109
                             onDelete: () {
101 110
                               onDelete(e);
102 111
                             },
112
+                            onBack: () {
113
+                              if(GetStorage().read('address')==null) {
114
+                                GetStorage().write('address', addressList[e]);
115
+                              }else {
116
+                                GetStorage().remove('address');
117
+                                GetStorage().write('address', addressList[e]);
118
+                              }
119
+                              Get.back();
120
+                            },
103 121
                           ),
104 122
                         )
105 123
                         .toList()),

+ 56
- 35
lib/pages/addressList/widget/AddressCard.dart 查看文件

@@ -6,30 +6,37 @@ import 'package:get/get_rx/src/rx_typedefs/rx_typedefs.dart';
6 6
 class AddressCard extends StatefulWidget {
7 7
   final Address item;
8 8
   final int No;
9
+  final bool isBack;
9 10
   final GestureTapCallback onChange;
10 11
   final GestureTapCallback onDelete;
11 12
   final GestureTapCallback onEdit;
12
-  AddressCard(
13
+  final GestureTapCallback onBack;
14
+  const AddressCard(
13 15
       {Key? key,
14 16
       required this.item,
15 17
       required this.No,
18
+      required this.isBack,
16 19
       required this.onChange,
17 20
       required this.onDelete,
18
-      required this.onEdit})
21
+      required this.onEdit,
22
+      required this.onBack})
19 23
       : super(key: key);
20 24
 
21 25
   @override
22 26
   _AddressCard createState() =>
23
-      _AddressCard(item, No, onChange, onDelete, onEdit);
27
+      _AddressCard(item, No, onChange, onDelete, onEdit, isBack, onBack);
24 28
 }
25 29
 
26 30
 class _AddressCard extends State<AddressCard> {
27 31
   final Address item;
28 32
   final int No;
33
+  final bool isBack;
29 34
   final GestureTapCallback onChange;
30 35
   final GestureTapCallback onDelete;
31 36
   final GestureTapCallback onEdit;
32
-  _AddressCard(this.item, this.No, this.onChange, this.onDelete, this.onEdit);
37
+  final GestureTapCallback onBack;
38
+  _AddressCard(this.item, this.No, this.onChange, this.onDelete, this.onEdit,
39
+      this.isBack, this.onBack);
33 40
   @override
34 41
   Widget build(BuildContext context) {
35 42
     return Container(
@@ -81,7 +88,7 @@ class _AddressCard extends State<AddressCard> {
81 88
               decoration: BoxDecoration(
82 89
                 border: Border(
83 90
                   bottom: BorderSide(
84
-                      width: 0.5.h,
91
+                      width: 1.h,
85 92
                       color: const Color(0xcc000000),
86 93
                       style: BorderStyle.solid),
87 94
                 ),
@@ -113,39 +120,53 @@ class _AddressCard extends State<AddressCard> {
113 120
               ),
114 121
             ),
115 122
           ),
116
-          Row(
117
-            mainAxisAlignment: MainAxisAlignment.spaceBetween,
118
-            children: [
119
-              GestureDetector(
120
-                onTap: onChange,
121
-                child: Row(
122
-                  children: [
123
-                    const Text('设为默认地址'),
124
-                    Radio<bool>(
125
-                        value: true,
126
-                        activeColor: const Color(0xFFFF703B),
127
-                        groupValue: item.isDefault,
128
-                        onChanged: (value){
129
-                          onChange();
130
-                        }),
131
-                  ],
123
+          if (isBack)
124
+            GestureDetector(
125
+              onTap: onBack,
126
+              child: Container(
127
+                width: 315.w,
128
+                margin: EdgeInsets.fromLTRB(0, 5.w, 0, 0),
129
+                child: Text(
130
+                  '选择此地址',
131
+                  style:
132
+                      TextStyle(fontSize: 17.sp, fontWeight: FontWeight.w800),
132 133
                 ),
133 134
               ),
134
-              GestureDetector(
135
-                onTap: onDelete,
136
-                child: Row(
137
-                  children: [
138
-                    const Text('删除'),
139
-                    Image.asset(
140
-                      'images/icons/delete.png',
141
-                      width: 25.w,
142
-                      height: 25.w,
143
-                    ),
144
-                  ],
135
+            ),
136
+          if (!isBack)
137
+            Row(
138
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
139
+              children: [
140
+                GestureDetector(
141
+                  onTap: onChange,
142
+                  child: Row(
143
+                    children: [
144
+                      const Text('设为默认地址'),
145
+                      Radio<bool>(
146
+                          value: true,
147
+                          activeColor: const Color(0xFFFF703B),
148
+                          groupValue: item.isDefault,
149
+                          onChanged: (value) {
150
+                            onChange();
151
+                          }),
152
+                    ],
153
+                  ),
145 154
                 ),
146
-              ),
147
-            ],
148
-          ),
155
+                GestureDetector(
156
+                  onTap: onDelete,
157
+                  child: Row(
158
+                    children: [
159
+                      const Text('删除'),
160
+                      Image.asset(
161
+                        'images/icons/delete.png',
162
+                        width: 25.w,
163
+                        height: 25.w,
164
+                      ),
165
+                    ],
166
+                  ),
167
+                ),
168
+              ],
169
+            ),
149 170
         ],
150 171
       ),
151 172
     );

+ 1
- 1
lib/pages/machinery/detail/index.dart 查看文件

@@ -7,7 +7,7 @@ import 'widgets/detail.dart';
7 7
 class MachineryDetailPage extends BasicPage {
8 8
   // 响应预约事件
9 9
   void handleClick() {
10
-    Get.back();
10
+    Get.toNamed('/orderConfirmation');
11 11
   }
12 12
 
13 13
   @override

+ 103
- 32
lib/pages/orderInfo/index.dart 查看文件

@@ -1,11 +1,11 @@
1
+import 'package:farmer_client/widgets/DefaultButton.dart';
1 2
 import 'package:flutter/material.dart';
2 3
 import 'package:flutter_screenutil/flutter_screenutil.dart';
4
+import 'package:fluttertoast/fluttertoast.dart';
5
+import 'package:get/get.dart';
3 6
 
4 7
 import '../../widgets/OrderInfoCard.dart';
5 8
 
6
-
7
-
8
-
9 9
 class OrderPageInfo extends StatefulWidget {
10 10
   const OrderPageInfo({Key? key}) : super(key: key);
11 11
 
@@ -14,6 +14,32 @@ class OrderPageInfo extends StatefulWidget {
14 14
 }
15 15
 
16 16
 class _OrderPageInfoState extends State<OrderPageInfo> {
17
+  void onCancel() {
18
+    showDialog(
19
+        context: context,
20
+        builder: (context) {
21
+          return AlertDialog(content: Text("您确定要取消订单吗?"), actions: <Widget>[
22
+            TextButton(
23
+              child: Text("取消"),
24
+              onPressed: () {
25
+                print("取消");
26
+                Navigator.pop(context, 'Cancle');
27
+              },
28
+            ),
29
+            TextButton(
30
+                child: Text("确定"),
31
+                onPressed: () {
32
+                  // setState(() {
33
+                  //   addressList.remove(addressList[e]);
34
+                  // });
35
+                  Navigator.pop(context, "Ok");
36
+                  Fluttertoast.showToast(msg: '取消成功!');
37
+                  Get.offAllNamed('/');
38
+                })
39
+          ]);
40
+        });
41
+  }
42
+
17 43
   @override
18 44
   Widget build(BuildContext context) {
19 45
     return Scaffold(
@@ -31,44 +57,89 @@ class _OrderPageInfoState extends State<OrderPageInfo> {
31 57
               fontWeight: FontWeight.bold),
32 58
         ),
33 59
       ),
34
-      body:      Column(
60
+      body: Column(
35 61
         children: [
36 62
           OrderInfoCard(),
37
-
63
+          Spacer(),
38 64
           Container(
39
-            height: 130.h,
40
-            margin: EdgeInsets.only(top: 20.0, bottom: 0.0),
41
-            alignment: Alignment.bottomCenter,
42
-            child: SizedBox(
43
-              width: 315.w,
44
-              height: 49.h,
45
-              child: ElevatedButton(
46
-                onPressed: () {
47
-                  // _handelSubmit();
48
-                  print('用户点击了支付啊阿松大撒地方');
49
-                },
50
-                child: const Text(
51
-                  "支付",
52
-                  style: TextStyle(
53
-                      fontSize: 18,
54
-                      color: Colors.white,
55
-                      fontWeight: FontWeight.bold),
65
+            margin: EdgeInsets.fromLTRB(15.w, 0, 15.w, 50.h),
66
+            child: Row(
67
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
68
+              children: [
69
+                GestureDetector(
70
+                  onTap: () {
71
+                    onCancel();
72
+                  },
73
+                  child: Container(
74
+                    width: 150.w,
75
+                    height: 49.h,
76
+                    decoration: BoxDecoration(
77
+                        color: const Color(0xffffffff),
78
+                        border: Border.all(
79
+                            color: const Color(0xFFFF703B),
80
+                            width: 1.w,
81
+                            style: BorderStyle.solid),
82
+                        borderRadius:
83
+                            BorderRadius.all(Radius.circular(24.5.w))),
84
+                    child: Center(
85
+                      child: Text(
86
+                        '取消',
87
+                        style: TextStyle(
88
+                            fontSize: 20.sp,
89
+                            color: const Color(0xFFFF703B),
90
+                            fontWeight: FontWeight.bold),
91
+                      ),
92
+                    ),
93
+                  ),
56 94
                 ),
57
-                style: ButtonStyle(
58
-                  elevation: MaterialStateProperty.all(0),
59
-                  backgroundColor:
60
-                  MaterialStateProperty.all(const Color(0xFFFF703B)),
61
-                  shape: MaterialStateProperty.all(
62
-                      const RoundedRectangleBorder(
63
-                          borderRadius:
64
-                          BorderRadius.all(Radius.circular(24.4)))),
95
+                DefaultButton(
96
+                  color: const Color(0xffffffff),
97
+                  backColor: const Color(0xFFFF703B),
98
+                  width: 150.w,
99
+                  height: 49.h,
100
+                  text: '支付',
101
+                  onPressed: () {
102
+                    Fluttertoast.showToast(msg: '支付成功!');
103
+                    Get.offAllNamed('/');
104
+                  },
105
+                  margin: const EdgeInsets.all(0),
106
+                  fontSize: 20.sp,
107
+                  radius: 24.5.w,
65 108
                 ),
66
-              ),
109
+              ],
67 110
             ),
68 111
           ),
112
+          // Container(
113
+          //   height: 130.h,
114
+          //   margin: EdgeInsets.only(top: 20.0, bottom: 0.0),
115
+          //   alignment: Alignment.bottomCenter,
116
+          //   child: SizedBox(
117
+          //     width: 315.w,
118
+          //     height: 49.h,
119
+          //     child: ElevatedButton(
120
+          //       onPressed: () {
121
+          //         // _handelSubmit();
122
+          //         print('用户点击了支付啊阿松大撒地方');
123
+          //       },
124
+          //       child: const Text(
125
+          //         "支付",
126
+          //         style: TextStyle(
127
+          //             fontSize: 18,
128
+          //             color: Colors.white,
129
+          //             fontWeight: FontWeight.bold),
130
+          //       ),
131
+          //       style: ButtonStyle(
132
+          //         elevation: MaterialStateProperty.all(0),
133
+          //         backgroundColor:
134
+          //             MaterialStateProperty.all(const Color(0xFFFF703B)),
135
+          //         shape: MaterialStateProperty.all(const RoundedRectangleBorder(
136
+          //             borderRadius: BorderRadius.all(Radius.circular(24.4)))),
137
+          //       ),
138
+          //     ),
139
+          //   ),
140
+          // ),
69 141
         ],
70 142
       ),
71 143
     );
72
-
73 144
   }
74 145
 }

+ 87
- 0
lib/pages/search/index.jsx.dart 查看文件

@@ -0,0 +1,87 @@
1
+import 'package:farmer_client/widgets/NullCard.dart';
2
+import 'package:flutter/material.dart';
3
+import 'package:flutter_screenutil/flutter_screenutil.dart';
4
+import '../../widgets/CarsCard.dart';
5
+
6
+class SearchPage extends StatefulWidget {
7
+  const SearchPage({Key? key}) : super(key: key);
8
+
9
+  @override
10
+  State<SearchPage> createState() => _SearchPage();
11
+}
12
+
13
+class _SearchPage extends State<SearchPage> {
14
+  @override
15
+  Widget build(BuildContext context) {
16
+    return Scaffold(
17
+      resizeToAvoidBottomInset: false,
18
+      appBar: AppBar(
19
+        elevation: 0,
20
+        centerTitle: true,
21
+        backgroundColor: Colors.white,
22
+        title: Text(
23
+          '搜索',
24
+          style: TextStyle(
25
+              color: Colors.black,
26
+              fontSize: 17.sp,
27
+              letterSpacing: 2,
28
+              fontWeight: FontWeight.bold),
29
+        ),
30
+      ),
31
+      body: Container(
32
+          decoration: const BoxDecoration(
33
+            color: Colors.white,
34
+          ),
35
+          child: ListView(children: [
36
+            Container(
37
+              width: 345.w,
38
+              height: 34.h,
39
+              margin: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.w),
40
+              padding: EdgeInsets.symmetric(vertical: 0, horizontal: 10.w),
41
+              decoration: BoxDecoration(
42
+                  color: Color(0xFFf8f8f8),
43
+                  borderRadius: BorderRadius.all(Radius.circular(17.w))),
44
+              child: Row(
45
+                mainAxisAlignment: MainAxisAlignment.center,
46
+                children: [
47
+                  Image.asset(
48
+                    'images/icons/search.png',
49
+                    width: 15.w,
50
+                    height: 15.w,
51
+                  ),
52
+                  Container(
53
+                    width: 300.w,
54
+                    margin: EdgeInsets.fromLTRB(5.w, 0, 0, 0),
55
+                    child: TextField(
56
+                      style: TextStyle(fontSize: 14.sp),
57
+                      decoration: const InputDecoration(
58
+                        isCollapsed: true,
59
+                        hintText: '搜索关键字查询',
60
+                        border: InputBorder.none,
61
+                        counterText: '', //去掉计数
62
+                        floatingLabelBehavior: FloatingLabelBehavior.never,
63
+                      ),
64
+                      onChanged: (e) {
65
+                        print(999);
66
+                        setState(() {});
67
+                      },
68
+                    ),
69
+                  ),
70
+                ],
71
+              ),
72
+            ),
73
+            Container(
74
+              child: Column(
75
+                children: [
76
+                  // NullCard(text: '暂无农机信息'),
77
+                  CarsCard(),
78
+                  CarsCard(),
79
+                  CarsCard(),
80
+                  CarsCard(),
81
+                ],
82
+              ),
83
+            )
84
+          ])),
85
+    );
86
+  }
87
+}

+ 6
- 0
lib/routes/pages.dart 查看文件

@@ -1,10 +1,13 @@
1 1
 
2 2
 import 'package:farmer_client/pages/ArticleInfo/ArticleInfo.dart';
3
+import 'package:farmer_client/pages/OrderConfirmation/index.dart';
3 4
 import 'package:farmer_client/pages/aboutUs/index.dart';
4 5
 import 'package:farmer_client/pages/addAddress/index.dart';
5 6
 import 'package:farmer_client/pages/addressList/index.dart';
6 7
 import 'package:farmer_client/pages/agreement/index.dart';
7 8
 import 'package:farmer_client/pages/feedback/index.dart';
9
+import 'package:farmer_client/pages/orderInfo/index.dart';
10
+import 'package:farmer_client/pages/search/index.jsx.dart';
8 11
 import 'package:farmer_client/pages/userInfo/index.dart';
9 12
 import 'package:get/get.dart';
10 13
 import '../pages/MoreCars/index.dart';
@@ -24,4 +27,7 @@ List<GetPage> pages = [
24 27
   GetPage(name: '/aboutUs', page: () =>  AboutUs()),
25 28
   GetPage(name: '/agreement', page: () =>  Agreement()),
26 29
   GetPage(name: '/feedback', page: () =>  Feedback()),
30
+  GetPage(name: '/orderConfirmation', page: () =>  OrderConfirmation()),
31
+  GetPage(name: '/orderPageInfo', page: () =>  OrderPageInfo()),
32
+  GetPage(name: '/searchPage', page: () =>  SearchPage()),
27 33
 ];

+ 63
- 0
lib/services/homeAPI.dart 查看文件

@@ -0,0 +1,63 @@
1
+
2
+
3
+import 'package:dio/dio.dart';
4
+import 'package:farmer_client/utils/Request.dart';
5
+import 'package:fluttertoast/fluttertoast.dart';
6
+
7
+
8
+
9
+/**
10
+ * banner轮播图
11
+ * @param {*} data
12
+ * @returns
13
+ */
14
+Future getHomeBanner(String position)async{
15
+  return request('/banner',options: Options(method: 'GET'),data: { 'position': position}).catchError((error) =>
16
+  { Fluttertoast.showToast(
17
+      msg: error.error['message']
18
+  ),});
19
+  
20
+}
21
+
22
+
23
+
24
+/**
25
+ * 农机列表
26
+ * @param {*} data
27
+ * @returns
28
+ */
29
+Future getMachinery(String location)async{
30
+  return request('/machinery',options: Options(method: 'GET'),queryParameters: { 'location': location}).catchError((error) =>
31
+  { Fluttertoast.showToast(
32
+      msg: error.error['message']
33
+  ),});
34
+
35
+}
36
+
37
+
38
+
39
+/**
40
+ * 农机详情
41
+ * @param {*} data
42
+ * @returns
43
+ */
44
+Future getMachineryInfo(String id,String location ,bool attached)async{
45
+  return request('/machinery-summary',options: Options(method: 'GET'),queryParameters: { 'id': id},data: {'location': location,'attached': attached}).catchError((error) =>
46
+  { Fluttertoast.showToast(
47
+      msg: error.error['message']
48
+  ),});
49
+
50
+}
51
+
52
+
53
+/**
54
+ * 农机分类Tab列查询
55
+ * @param {*} data
56
+ * @returns
57
+ */
58
+Future getMachineryType()async{
59
+  return request('/machinery-type',options: Options(method: 'GET'));
60
+}
61
+
62
+
63
+

+ 0
- 3
lib/widgets/CarsCard.dart 查看文件

@@ -38,7 +38,6 @@ class CarsCard extends StatelessWidget {
38 38
           GestureDetector(
39 39
             onTap: (){
40 40
               Get.to(MachineryDetailPage());
41
-
42 41
             },
43 42
             child:Image.network(
44 43
               "http://yz-shigongli.oss-accelerate.aliyuncs.com/2022-03/1648094119154-7b280bbf63105a8e90299e2d79c8c6ee.jpeg",
@@ -113,8 +112,6 @@ class CarsCard extends StatelessWidget {
113 112
                     child: ElevatedButton(
114 113
                       onPressed: () {
115 114
                         Get.to(OrderConfirmation());
116
-                        print('点我去预约');
117
-
118 115
                       },
119 116
                       child: const Text(
120 117
                         "预约",

+ 33
- 0
lib/widgets/NullCard.dart 查看文件

@@ -0,0 +1,33 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+class NullCard extends StatelessWidget {
5
+  final String text;
6
+  const NullCard({Key? key, required this.text}) : super(key: key);
7
+  @override
8
+  Widget build(BuildContext context) {
9
+    return Container(
10
+      width: 345.w,
11
+      padding: EdgeInsets.all(30.w),
12
+      alignment: Alignment.center,
13
+      child: Column(
14
+        children: [
15
+          Container(
16
+            margin: EdgeInsets.fromLTRB(0, 0, 0, 22.h),
17
+            child: Image.asset(
18
+              'images/icons/nullDataImg.png',
19
+              width: 135.w,
20
+            ),
21
+          ),
22
+          Text(
23
+            text,
24
+            style: TextStyle(
25
+                fontSize: 17.sp, color: Color(0xFFb4b4b4)),
26
+          )
27
+        ],
28
+      ),
29
+    );
30
+  }
31
+
32
+
33
+}

+ 16
- 17
lib/widgets/Search.dart 查看文件

@@ -1,7 +1,6 @@
1 1
 import 'package:flutter/material.dart';
2 2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3 3
 
4
-
5 4
 class Search extends StatefulWidget {
6 5
   const Search({Key? key}) : super(key: key);
7 6
 
@@ -10,20 +9,18 @@ class Search extends StatefulWidget {
10 9
 }
11 10
 
12 11
 class _SearchState extends State<Search> {
13
-
14 12
   @override
15 13
   Widget build(BuildContext context) {
16
-    return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints){
17
-      return  Column(
14
+    return LayoutBuilder(
15
+        builder: (BuildContext context, BoxConstraints constraints) {
16
+      return Column(
18 17
         children: [
19 18
           Container(
20
-            decoration: BoxDecoration(
21
-              color: Colors.white
22
-            ),
23
-      width: constraints.maxWidth,
24
-      height: 34,
25
-      alignment: Alignment.center,
26
-      child:  TextField(
19
+            decoration: BoxDecoration(color: Colors.white),
20
+            width: 345.w,
21
+            height: 34,
22
+            alignment: Alignment.center,
23
+            child: TextField(
27 24
               onChanged: (value) {
28 25
                 print('打一个字我搜索一下$value');
29 26
               },
@@ -31,17 +28,22 @@ class _SearchState extends State<Search> {
31 28
                 FocusScope.of(context).requestFocus(FocusNode());
32 29
                 print('点击键盘搜索');
33 30
               },
34
-              style: const TextStyle(fontSize: 15, color: Colors.black, textBaseline: TextBaseline.alphabetic),
31
+              style: const TextStyle(
32
+                  fontSize: 15,
33
+                  color: Colors.black,
34
+                  textBaseline: TextBaseline.alphabetic),
35 35
               decoration: const InputDecoration(
36 36
                 isDense: true,
37 37
                 prefixIcon: Padding(
38 38
                   padding: EdgeInsets.only(left: 0),
39
-                  child:  Icon(Icons.search,),
39
+                  child: Icon(
40
+                    Icons.search,
41
+                  ),
40 42
                 ),
41 43
                 fillColor: Color(0x30cccccc),
42 44
                 filled: true,
43 45
                 border: OutlineInputBorder(borderSide: BorderSide.none),
44
-      contentPadding: EdgeInsets.all(0),
46
+                contentPadding: EdgeInsets.all(0),
45 47
                 enabledBorder: OutlineInputBorder(
46 48
                     borderSide: BorderSide(color: Color(0x00FF0000)),
47 49
                     borderRadius: BorderRadius.all(Radius.circular(100))),
@@ -49,14 +51,11 @@ class _SearchState extends State<Search> {
49 51
                 hintStyle: TextStyle(
50 52
                   textBaseline: TextBaseline.alphabetic, //用于提示文字对齐
51 53
                 ),
52
-
53 54
               ),
54
-
55 55
             ),
56 56
           ),
57 57
         ],
58 58
       );
59 59
     });
60
-
61 60
   }
62 61
 }