浏览代码

pagesHomeServer

[baozhangchao] 3 年前
父节点
当前提交
01663f0411
共有 39 个文件被更改,包括 2045 次插入0 次删除
  1. 6
    0
      android/app/src/main/java/com/example/farmer_client/MainActivity.java
  2. 二进制
      images/HomesNOImgaes.png
  3. 二进制
      images/HomesOFFImgaes.png
  4. 二进制
      images/MineNOImgaes.png
  5. 二进制
      images/MineOFFImgaes.png
  6. 二进制
      images/OrdersNOImgaes.png
  7. 二进制
      images/OrdersOFFImgaes.png
  8. 二进制
      images/icons/ListBack.png
  9. 二进制
      images/icons/deletes.png
  10. 二进制
      images/newsOFFImages.png
  11. 二进制
      images/newsONImages.png
  12. 89
    0
      lib/components/UI/DefaultButton.dart
  13. 1
    0
      lib/models/Store.dart
  14. 15
    0
      lib/models/User.dart
  15. 28
    0
      lib/models/entities/banner.dart
  16. 62
    0
      lib/pages/Information/ArticleInfo.dart
  17. 141
    0
      lib/pages/Information/index.dart
  18. 11
    0
      lib/pages/TabBar/Information_page.dart
  19. 11
    0
      lib/pages/TabBar/Mine_page.dart
  20. 11
    0
      lib/pages/TabBar/Orders_page.dart
  21. 10
    0
      lib/pages/TabBar/home_page.dart
  22. 133
    0
      lib/pages/TabBar/index.dart
  23. 71
    0
      lib/pages/TabBar/index_page.dart
  24. 1
    0
      lib/pages/TabBar/member_page.dart
  25. 125
    0
      lib/pages/TabBar/widgets/Information/index.dart
  26. 116
    0
      lib/pages/TabBar/widgets/home/index.dart
  27. 103
    0
      lib/pages/TabBar/widgets/home/widgets/headers.dart
  28. 95
    0
      lib/pages/TabBar/widgets/main/index.dart
  29. 161
    0
      lib/pages/TabBar/widgets/main/widgets/OtherColumn.dart
  30. 99
    0
      lib/pages/TabBar/widgets/main/widgets/UserAddress.dart
  31. 112
    0
      lib/pages/TabBar/widgets/main/widgets/UserInfo.dart
  32. 61
    0
      lib/pages/TabBar/widgets/order/index.dart
  33. 1
    0
      lib/pages/home.dart
  34. 109
    0
      lib/pages/home2.dart
  35. 155
    0
      lib/pages/main/widgets/OtherColumn.dart
  36. 98
    0
      lib/pages/main/widgets/UserAddress.dart
  37. 111
    0
      lib/pages/main/widgets/UserInfo.dart
  38. 87
    0
      lib/pages/search/index.jsx.dart
  39. 22
    0
      lib/widgets/amap/const_config.dart

+ 6
- 0
android/app/src/main/java/com/example/farmer_client/MainActivity.java 查看文件

@@ -0,0 +1,6 @@
1
+package com.example.farmer_client;
2
+
3
+import io.flutter.embedding.android.FlutterActivity;
4
+
5
+public class MainActivity extends FlutterActivity {
6
+}

二进制
images/HomesNOImgaes.png 查看文件


二进制
images/HomesOFFImgaes.png 查看文件


二进制
images/MineNOImgaes.png 查看文件


二进制
images/MineOFFImgaes.png 查看文件


二进制
images/OrdersNOImgaes.png 查看文件


二进制
images/OrdersOFFImgaes.png 查看文件


二进制
images/icons/ListBack.png 查看文件


二进制
images/icons/deletes.png 查看文件


二进制
images/newsOFFImages.png 查看文件


二进制
images/newsONImages.png 查看文件


+ 89
- 0
lib/components/UI/DefaultButton.dart 查看文件

@@ -0,0 +1,89 @@
1
+import 'package:flutter/material.dart';
2
+
3
+
4
+
5
+class DefaultButton extends StatefulWidget {
6
+  //点击回调
7
+  final GestureTapCallback onPressed;
8
+  final String text;
9
+  final EdgeInsetsGeometry margin;
10
+  final double width;
11
+  final double height;
12
+  final double? fontSize;
13
+  final Color backColor;
14
+  final Color color;
15
+
16
+  EdgeInsetsGeometry marginDefault =
17
+  const EdgeInsets.fromLTRB(0, 90.0, 0, 30); //按钮默认的margin值
18
+
19
+  DefaultButton({
20
+    Key? key,
21
+    required this.onPressed,
22
+    required this.text,
23
+    required this.margin,
24
+    required this.width,
25
+    required this.height,
26
+    this.fontSize,
27
+    required this.backColor,
28
+    required this.color,
29
+  }) : super(key: key);
30
+
31
+  @override
32
+  State createState() {
33
+    if (margin == null) {
34
+      return _DefaultButtonState(onPressed, text, marginDefault,width,height,fontSize,backColor,color);
35
+    }
36
+    return _DefaultButtonState(onPressed, text, margin,width,height,fontSize,backColor,color);
37
+  }
38
+}
39
+
40
+class _DefaultButtonState extends State<DefaultButton> {
41
+  //点击回调
42
+  final GestureTapCallback onPressed;
43
+  final String text;
44
+  final EdgeInsetsGeometry margin;
45
+  final double width;
46
+  final double height;
47
+  final double? fontSize;
48
+  final Color backColor;
49
+  final Color color;
50
+  _DefaultButtonState(
51
+      this.onPressed,
52
+      this.text,
53
+      this.margin,
54
+      this.width,
55
+      this.height,
56
+      this.fontSize,
57
+      this.backColor,
58
+      this.color
59
+      );
60
+
61
+  @override
62
+  Widget build(BuildContext context) {
63
+    Widget _SectionBtn = Container(
64
+      margin: margin,
65
+      child: SizedBox(
66
+        width: width,
67
+        height: height,
68
+        child: RaisedButton(
69
+          color: backColor,
70
+          disabledColor: const Color(0xF5F6F7ff),
71
+          disabledTextColor: const Color(0xF5F6F7ff),
72
+          colorBrightness: Brightness.dark,
73
+          shape:
74
+          RoundedRectangleBorder(borderRadius: BorderRadius.circular(5.0)),
75
+          child: Text(text,style:  TextStyle(
76
+              fontSize: fontSize,
77
+              color: color,
78
+          ),),
79
+          textColor: Colors.white,
80
+          onPressed: onPressed,
81
+        ),
82
+      ),
83
+    );
84
+
85
+    return _SectionBtn;
86
+  }
87
+
88
+}
89
+

+ 1
- 0
lib/models/Store.dart 查看文件

@@ -0,0 +1 @@
1
+// TODO Implement this library.

+ 15
- 0
lib/models/User.dart 查看文件

@@ -0,0 +1,15 @@
1
+
2
+import 'package:farmer_client/models/entities/person.dart';
3
+import 'package:get/get.dart';
4
+
5
+class User extends GetxController {
6
+  Person? _person;
7
+  Person? get person => _person;
8
+  set person (Person? p) {
9
+    _person = p;
10
+    update();
11
+  }
12
+
13
+  bool get isLogin => _person != null;
14
+
15
+}

+ 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
+}

+ 62
- 0
lib/pages/Information/ArticleInfo.dart 查看文件

@@ -0,0 +1,62 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+class ArticleInfo extends StatelessWidget {
5
+  const ArticleInfo({Key? key}) : super(key: key);
6
+
7
+  @override
8
+  Widget build(BuildContext context) {
9
+    return Scaffold(
10
+        resizeToAvoidBottomInset: false,
11
+        appBar: AppBar(
12
+          title: Text('资讯'),
13
+          leading: Icon(Icons.arrow_back_ios),
14
+          // backgroundColor: Colors.transparent,
15
+          centerTitle: true,
16
+        ),
17
+        body: Container(
18
+          padding: EdgeInsets.fromLTRB(15, 30, 15, 50),
19
+
20
+          child: Column(
21
+            children: [
22
+              Container(
23
+                alignment: Alignment.center,
24
+                child:  Row(
25
+                  mainAxisAlignment: MainAxisAlignment.center,
26
+                  children: [
27
+                    Image(image: AssetImage('images/icons/decorate.png'),width: 17,),
28
+                    Text('我是22222222222标题',
29
+                    style: TextStyle(
30
+                      fontSize: 17.sp,
31
+                      fontWeight: FontWeight.bold,
32
+
33
+                    ),
34
+                    ),
35
+                    Image(image: AssetImage('images/icons/decorate.png'),width: 17),
36
+
37
+                  ],
38
+                ),
39
+              ),
40
+              Container(
41
+                padding: EdgeInsets.fromLTRB(0, 20, 0, 10),
42
+                width: 344.w,
43
+                child: Text('gr一年之计在于春,连日来,农业生产工作正在热火朝天的进行着:农技人员走村串户指导农户春耕生产,大型拖拉机忙着翻垦农田,植保无人机 ',
44
+                style: TextStyle(
45
+                  fontSize: 14.sp
46
+                ),
47
+                ) ,
48
+              ),
49
+              Container(
50
+                padding: EdgeInsets.fromLTRB(0, 10, 0,10),
51
+                child: Image(image: AssetImage('images/cars.png'),width:320.w,height:260.w,fit: BoxFit.fill,),
52
+
53
+              )
54
+
55
+
56
+            ],
57
+          ),
58
+        ),
59
+    );
60
+
61
+  }
62
+}

+ 141
- 0
lib/pages/Information/index.dart 查看文件

@@ -0,0 +1,141 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+import 'package:get/get_core/src/get_main.dart';
5
+
6
+class Information extends StatefulWidget {
7
+  const Information({Key? key}) : super(key: key);
8
+
9
+  @override
10
+  State<Information> createState() => _InformationState();
11
+}
12
+
13
+class _InformationState extends State<Information> {
14
+  @override
15
+  Widget build(BuildContext context) {
16
+    return Scaffold(
17
+      resizeToAvoidBottomInset: false,
18
+      appBar: AppBar(
19
+        title: Text('资讯'),
20
+        leading: Icon(Icons.arrow_back_ios),
21
+        // backgroundColor: Colors.transparent,
22
+        centerTitle: true,
23
+      ),
24
+      body: ListView(
25
+        children: [
26
+          // ListTile用不好
27
+
28
+          GestureDetector(
29
+            child:
30
+            Container(
31
+                padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
32
+                width: 310.w,
33
+                decoration: const BoxDecoration(
34
+                    border:Border(
35
+                        bottom:
36
+                        BorderSide(width: 0.5, color: Color(0x20000000)
37
+                          // 0x17000000
38
+                        ))
39
+                ),
40
+                child: Row(
41
+                  children: [
42
+                    Container(
43
+                      margin: EdgeInsets.fromLTRB(15, 0, 11, 0),
44
+                      width: 100,
45
+                      height: 100,
46
+                      decoration: BoxDecoration(
47
+                        image:  DecorationImage(
48
+                          image: AssetImage('images/cars.png'),
49
+                          fit: BoxFit.cover,
50
+                        ),
51
+
52
+                        borderRadius: BorderRadius.circular(12),
53
+                      ),
54
+                    )
55
+                    ,
56
+                    Column(
57
+                      crossAxisAlignment: CrossAxisAlignment.start,
58
+                      children: [
59
+                        Container(
60
+                          width: 240.w,
61
+                          padding: EdgeInsets.fromLTRB(0, 0, 0, 30),
62
+                          child: Text("我我就是一个标题,什阿三大苏打333萨达萨达萨达v么特不是",
63
+                              softWrap: true,
64
+                              maxLines: 2,
65
+                              textAlign: TextAlign.left,
66
+                              overflow: TextOverflow.ellipsis,
67
+                              style: TextStyle(
68
+                                fontSize: 17.sp, fontWeight: FontWeight.bold,)),
69
+                        ),
70
+                        Container(
71
+                          child: Text('2022-02-09'),
72
+                        )
73
+                      ],
74
+                    )
75
+                  ],
76
+                )
77
+            ),
78
+            onTap: () {
79
+              Get.toNamed('/ArticleInfo');
80
+            },
81
+          ),
82
+          GestureDetector(
83
+            child:
84
+            Container(
85
+                padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
86
+                width: 310.w,
87
+                decoration: const BoxDecoration(
88
+                    border:Border(
89
+                        bottom:
90
+                        BorderSide(width: 0.5, color: Color(0x20000000)
91
+                          // 0x17000000
92
+                        ))
93
+                ),
94
+                child: Row(
95
+                  children: [
96
+                    Container(
97
+                      margin: EdgeInsets.fromLTRB(15, 0, 11, 0),
98
+                      width: 100,
99
+                      height: 100,
100
+                      decoration: BoxDecoration(
101
+                        image:  DecorationImage(
102
+                          image: AssetImage('images/cars.png'),
103
+                          fit: BoxFit.cover,
104
+                        ),
105
+
106
+                        borderRadius: BorderRadius.circular(12),
107
+                      ),
108
+                    )
109
+                    ,
110
+                    Column(
111
+                      crossAxisAlignment: CrossAxisAlignment.start,
112
+                      children: [
113
+                        Container(
114
+                          width: 240.w,
115
+                          padding: EdgeInsets.fromLTRB(0, 0, 0, 30),
116
+                          child: Text("我我就是一个标题,什阿三大苏打333萨达萨达萨达v么特不是",
117
+                              softWrap: true,
118
+                              maxLines: 2,
119
+                              textAlign: TextAlign.left,
120
+                              overflow: TextOverflow.ellipsis,
121
+                              style: TextStyle(
122
+                                fontSize: 17.sp, fontWeight: FontWeight.bold,)),
123
+                        ),
124
+                        Container(
125
+                          child: Text('2022-02-09'),
126
+                        )
127
+                      ],
128
+                    )
129
+                  ],
130
+                )
131
+            ),
132
+            onTap: () {
133
+              print('进入资讯详情');
134
+            },
135
+          )
136
+
137
+        ],
138
+      ),
139
+    );
140
+  }
141
+}

+ 11
- 0
lib/pages/TabBar/Information_page.dart 查看文件

@@ -0,0 +1,11 @@
1
+import 'package:flutter/material.dart';
2
+
3
+class InformationPage extends StatelessWidget {
4
+  @override
5
+  Widget build(BuildContext context) {
6
+    // TODO: implement build
7
+    return Scaffold(
8
+      body: Center(child: Text('资讯')),
9
+    );
10
+  }
11
+}

+ 11
- 0
lib/pages/TabBar/Mine_page.dart 查看文件

@@ -0,0 +1,11 @@
1
+import 'package:flutter/material.dart';
2
+
3
+class MinePage extends StatelessWidget {
4
+  @override
5
+  Widget build(BuildContext context) {
6
+    // TODO: implement build
7
+    return Scaffold(
8
+      body: Center(child: Text('我的')),
9
+    );
10
+  }
11
+}

+ 11
- 0
lib/pages/TabBar/Orders_page.dart 查看文件

@@ -0,0 +1,11 @@
1
+import 'package:flutter/material.dart';
2
+
3
+class OrdersPage extends StatelessWidget {
4
+  @override
5
+  Widget build(BuildContext context) {
6
+    // TODO: implement build
7
+    return Scaffold(
8
+      body: Center(child: Text('订单')),
9
+    );
10
+  }
11
+}

+ 10
- 0
lib/pages/TabBar/home_page.dart 查看文件

@@ -0,0 +1,10 @@
1
+import 'package:flutter/material.dart';
2
+
3
+class HomePage extends StatelessWidget {
4
+  @override
5
+  Widget build(BuildContext context) {
6
+    return Scaffold(
7
+      body: Center(child: Text('首页')),
8
+    );
9
+  }
10
+}

+ 133
- 0
lib/pages/TabBar/index.dart 查看文件

@@ -0,0 +1,133 @@
1
+
2
+import 'package:flutter/material.dart';
3
+import 'package:flutter_screenutil/flutter_screenutil.dart';
4
+
5
+import '../TabBar/widgets/Information/index.dart';
6
+import '../TabBar/widgets/main/index.dart';
7
+import '../TabBar/widgets/order/index.dart';
8
+import '../TabBar/widgets/home/index.dart';
9
+
10
+class Home extends StatefulWidget {
11
+  const Home({Key? key}) : super(key: key);
12
+
13
+  @override
14
+  _Home createState() => _Home();
15
+}
16
+
17
+class _Home extends State<Home> {
18
+  //下标   当前tab
19
+  int _tabIndex = 0;
20
+
21
+  final List _titles = ['首页', '订单', '资讯','我的'];
22
+  final tabTextStyleSelected = TextStyle(
23
+      color: const Color(0xFFFF703B),
24
+      fontSize: 15.sp,
25
+      fontWeight: FontWeight.bold); //选线卡选中字体颜色
26
+  final tabTextStyleNormal = TextStyle(
27
+      color: const Color(0xFF323232),
28
+      fontSize: 15.sp,
29
+      fontWeight: FontWeight.bold); //选项卡未选中字体颜色
30
+
31
+  TextStyle getTabTextStyle(int curIndex) {
32
+    //设置tabbar 选中和未选中的状态文本
33
+    if (curIndex == _tabIndex) {
34
+      return tabTextStyleSelected;
35
+    }
36
+    return tabTextStyleNormal;
37
+  }
38
+
39
+  // 切换底部选项卡,标题的变化设置
40
+  Text getTabTitle(int curIndex) {
41
+    return Text(_titles[curIndex], style: getTabTextStyle(curIndex));
42
+  }
43
+
44
+  List images = [
45
+    ['images/index/HomesOFFImgaes.png', 'images/index/HomesNOImgaes.png'],
46
+    ['images/index/OrdersOFFImgaes.png', 'images/index/OrdersNOImgaes.png'],
47
+    ['images/index/newsONImages.png', 'images/index/newsOFFImages.png'],
48
+    ['images/index/MineOFFImgaes.png', 'images/index/MineNOImgaes.png'],
49
+  ];
50
+  Image getTabIcon(int curIndex) {
51
+    //设置tabbar选中和未选中的状态图标
52
+    if (curIndex == _tabIndex) {
53
+      return Image.asset(
54
+        images[curIndex][1],
55
+        width: 22.w,
56
+        height: 22.w,
57
+      );
58
+    }
59
+    return Image.asset(
60
+      images[curIndex][0],
61
+      width: 22.w,
62
+      height: 22.w,
63
+    );
64
+  }
65
+
66
+  Image getTabImage(path) {
67
+    return Image.asset(path, width: 22.w, height: 22.w);
68
+  }
69
+
70
+  //内容
71
+  var _body = [HomePage(), OrderPage(),Information(), MainPage()];
72
+
73
+  Widget tabBar(index) {
74
+    return GestureDetector(
75
+      behavior: HitTestBehavior.opaque,
76
+      onTap: () {
77
+        setState(() {
78
+          _tabIndex = index;
79
+        });
80
+      },
81
+      child: Container(
82
+        width: 93.w,
83
+        height: 65.h,
84
+        child: Column(
85
+          children: [
86
+            getTabIcon(index),
87
+            Padding(
88
+              padding: EdgeInsets.fromLTRB(0, 6.h, 0, 0),
89
+              child: getTabTitle(index),
90
+            )
91
+          ],
92
+        ),
93
+      ),
94
+    );
95
+  }
96
+
97
+  @override
98
+  Widget build(BuildContext context) {
99
+    return Scaffold(
100
+      backgroundColor: Colors.white,
101
+      appBar: AppBar(
102
+        elevation: 0,
103
+        centerTitle: true,
104
+        backgroundColor: Colors.white,
105
+        title: Text(
106
+          _titles[_tabIndex],
107
+          style: TextStyle(
108
+              color: Colors.black,
109
+              fontSize: 17.sp,
110
+              letterSpacing: 2,
111
+              fontWeight: FontWeight.bold),
112
+        ),
113
+      ),
114
+      body: _body[_tabIndex],
115
+      bottomNavigationBar: Container(
116
+        padding: EdgeInsets.fromLTRB(0, 7.h, 0, 7.h),
117
+        decoration: BoxDecoration(
118
+          color: const Color(0xFFFFFFFF),
119
+          boxShadow: [
120
+            BoxShadow(
121
+              color: const Color(0x14000000),
122
+              offset: Offset(0, -2.w),
123
+              blurRadius: 3.w,
124
+            ),
125
+          ],
126
+        ),
127
+        child: Row(
128
+          children:_titles.asMap().keys.map((index) =>tabBar(index)).toList(),
129
+        ),
130
+      ),
131
+    );
132
+  }
133
+}

+ 71
- 0
lib/pages/TabBar/index_page.dart 查看文件

@@ -0,0 +1,71 @@
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
+  _IndexPageState createState() => _IndexPageState();
10
+}
11
+
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
+}

+ 1
- 0
lib/pages/TabBar/member_page.dart 查看文件

@@ -0,0 +1 @@
1
+// TODO Implement this library.

+ 125
- 0
lib/pages/TabBar/widgets/Information/index.dart 查看文件

@@ -0,0 +1,125 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+import 'package:get/get_core/src/get_main.dart';
5
+
6
+import '../../../ArticleInfo/ArticleInfo.dart';
7
+
8
+class Information extends StatefulWidget {
9
+  const Information({Key? key}) : super(key: key);
10
+
11
+  @override
12
+  State<Information> createState() => _InformationState();
13
+}
14
+
15
+class _InformationState extends State<Information> {
16
+  @override
17
+  Widget build(BuildContext context) {
18
+    return ListView(
19
+      children: [
20
+        // ListTile用不好
21
+
22
+        GestureDetector(
23
+          child: Container(
24
+              padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
25
+              width: 310.w,
26
+              decoration: const BoxDecoration(
27
+                  border: Border(
28
+                      bottom: BorderSide(width: 0.5, color: Color(0x20000000)
29
+                          // 0x17000000
30
+                          ))),
31
+              child: Row(
32
+                children: [
33
+                  Container(
34
+                    margin: EdgeInsets.fromLTRB(15, 0, 11, 0),
35
+                    width: 100,
36
+                    height: 100,
37
+                    decoration: BoxDecoration(
38
+                      image: DecorationImage(
39
+                        image: AssetImage('images/cars.png'),
40
+                        fit: BoxFit.cover,
41
+                      ),
42
+                      borderRadius: BorderRadius.circular(12),
43
+                    ),
44
+                  ),
45
+                  Column(
46
+                    crossAxisAlignment: CrossAxisAlignment.start,
47
+                    children: [
48
+                      Container(
49
+                        width: 240.w,
50
+                        padding: EdgeInsets.fromLTRB(0, 0, 0, 30),
51
+                        child: Text("我我就是一个标题,什阿三大苏打333萨达萨达萨达v么特不是",
52
+                            softWrap: true,
53
+                            maxLines: 2,
54
+                            textAlign: TextAlign.left,
55
+                            overflow: TextOverflow.ellipsis,
56
+                            style: TextStyle(
57
+                              fontSize: 17.sp,
58
+                              fontWeight: FontWeight.bold,
59
+                            )),
60
+                      ),
61
+                      Container(
62
+                        child: Text('2022-02-09'),
63
+                      )
64
+                    ],
65
+                  )
66
+                ],
67
+              )),
68
+          onTap: () {
69
+            Get.to(ArticleInfo());
70
+          },
71
+        ),
72
+        GestureDetector(
73
+          child: Container(
74
+              padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
75
+              width: 310.w,
76
+              decoration: const BoxDecoration(
77
+                  border: Border(
78
+                      bottom: BorderSide(width: 0.5, color: Color(0x20000000)
79
+                          // 0x17000000
80
+                          ))),
81
+              child: Row(
82
+                children: [
83
+                  Container(
84
+                    margin: EdgeInsets.fromLTRB(15, 0, 11, 0),
85
+                    width: 100,
86
+                    height: 100,
87
+                    decoration: BoxDecoration(
88
+                      image: DecorationImage(
89
+                        image: AssetImage('images/cars.png'),
90
+                        fit: BoxFit.cover,
91
+                      ),
92
+                      borderRadius: BorderRadius.circular(12),
93
+                    ),
94
+                  ),
95
+                  Column(
96
+                    crossAxisAlignment: CrossAxisAlignment.start,
97
+                    children: [
98
+                      Container(
99
+                        width: 240.w,
100
+                        padding: EdgeInsets.fromLTRB(0, 0, 0, 30),
101
+                        child: Text("我我就是一个标题,什阿三大苏打333萨达萨达萨达v么特不是",
102
+                            softWrap: true,
103
+                            maxLines: 2,
104
+                            textAlign: TextAlign.left,
105
+                            overflow: TextOverflow.ellipsis,
106
+                            style: TextStyle(
107
+                              fontSize: 17.sp,
108
+                              fontWeight: FontWeight.bold,
109
+                            )),
110
+                      ),
111
+                      Container(
112
+                        child: Text('2022-02-09'),
113
+                      )
114
+                    ],
115
+                  )
116
+                ],
117
+              )),
118
+          onTap: () {
119
+            print('进入资讯详情');
120
+          },
121
+        )
122
+      ],
123
+    );
124
+  }
125
+}

+ 116
- 0
lib/pages/TabBar/widgets/home/index.dart 查看文件

@@ -0,0 +1,116 @@
1
+import 'package:carousel_slider/carousel_slider.dart';
2
+import 'package:farmer_client/pages/TabBar/widgets/home/widgets/headers.dart';
3
+import 'package:flutter/material.dart';
4
+import 'package:flutter_screenutil/flutter_screenutil.dart';
5
+import 'package:get/get.dart';
6
+import 'package:get/get_core/src/get_main.dart';
7
+import '../../../../models/app.dart';
8
+import '../../../../models/entities/banner.dart';
9
+import '../../../../services/homeAPI.dart';
10
+import '../../../../widgets/CarsCard.dart';
11
+import 'package:farmer_client/models/app.dart';
12
+import '../../../../widgets/layout/BasicPage.dart';
13
+import '../../../MoreCars/index.dart';
14
+
15
+
16
+
17
+class HomePage extends BasicPage {
18
+
19
+  final bannerList = Rx<List<banner>>([]);
20
+
21
+  @override
22
+  void beforeShow() {
23
+    final location = AppController.t.locationStr;
24
+
25
+    getHomeBanner('banner').then((value) {
26
+      value.forEach((item) {
27
+        bannerList.value.add(banner.fromJson(item));
28
+      });
29
+    });
30
+  }
31
+
32
+  List<Widget>? _renderList() {
33
+    return bannerList.value.map((item) => Container(
34
+      child: Center(
35
+          child: Image.network(item.thumb.toString(),
36
+              fit: BoxFit.cover, width: 350.w)),
37
+    )).toList();
38
+  }
39
+
40
+  @override
41
+  Widget builder (BuildContext context) {
42
+    return Container(
43
+      alignment: Alignment.center,
44
+      padding: EdgeInsets.fromLTRB(15.w, 0, 15.w, 0),
45
+      child: Column(
46
+        children: [
47
+          Container(
48
+            child: TypeHeader(
49
+              type: true,
50
+            ),
51
+          ),
52
+          Container(
53
+            margin: EdgeInsets.fromLTRB(0, 15, 0, 0),
54
+            child:
55
+                Obx(() => CarouselSlider(
56
+              items: _renderList(),
57
+              options: CarouselOptions(
58
+                autoPlay: true,
59
+                enlargeCenterPage: false, //图片中心放大
60
+                viewportFraction: 1, //每个页面应占据的视口部分。默认为 0.8,这意味着每个页面填充 80% 的轮播。
61
+                // aspectRatio: 1.6,//纵横比
62
+                height: 214.w,
63
+                initialPage: 1, //初始页
64
+              ),
65
+            )),
66
+          ),
67
+          Container(
68
+              margin: EdgeInsets.fromLTRB(0, 20, 0, 20),
69
+              child: Column(
70
+                children: [
71
+                  Row(
72
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
73
+                    children: [
74
+                      Container(
75
+                        child: Row(
76
+                          children: [
77
+                            Padding(
78
+                              padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
79
+                              child: Image(
80
+                                image:
81
+                                    AssetImage('images/icons/carsListImga.png'),
82
+                                fit: BoxFit.cover,
83
+                                width: 20.w,
84
+                              ),
85
+                            ),
86
+                            Text(
87
+                              '农机列表',
88
+                              style: TextStyle(
89
+                                  color: Color(0xff222222),
90
+                                  fontSize: 20.sp,
91
+                                  fontWeight: FontWeight.bold),
92
+                            )
93
+                          ],
94
+                        ),
95
+                      ),
96
+                      Container(
97
+                        child: GestureDetector(
98
+                          child: Text('更多 >>'),
99
+                          onTap: () {
100
+                            print('点我进入农机搜索/更多页');
101
+                            Get.to(MoreCars());
102
+                          },
103
+                        ),
104
+                      )
105
+                    ],
106
+                  ),
107
+                  CarsCard(),
108
+                  CarsCard(),
109
+                  CarsCard(),
110
+                ],
111
+              )),
112
+        ],
113
+      ),
114
+    );
115
+  }
116
+}

+ 103
- 0
lib/pages/TabBar/widgets/home/widgets/headers.dart 查看文件

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

+ 95
- 0
lib/pages/TabBar/widgets/main/index.dart 查看文件

@@ -0,0 +1,95 @@
1
+import 'package:get/get.dart';
2
+import 'package:get_storage/get_storage.dart';
3
+
4
+import './widgets/OtherColumn.dart';
5
+import './widgets/UserAddress.dart';
6
+import './widgets/UserInfo.dart';
7
+import 'package:flutter/material.dart';
8
+import 'package:flutter_screenutil/flutter_screenutil.dart';
9
+
10
+class MainPage extends StatefulWidget {
11
+  const MainPage({Key? key}) : super(key: key);
12
+
13
+  @override
14
+  State<MainPage> createState() => _MainPageState();
15
+}
16
+
17
+class _MainPageState extends State<MainPage> {
18
+  GetStorage box = GetStorage();
19
+  @override
20
+  Widget build(BuildContext context) {
21
+    return Container(
22
+      alignment: Alignment.center,
23
+      child: ListView(
24
+        children: [
25
+          Column(
26
+            children: [
27
+              UserInfo(), //头部,头像手机号姓名
28
+              UserAddress(), //用户地址
29
+              OtherColumn(), //功能菜单栏
30
+              Container(
31
+                height: 70.h,
32
+                margin: EdgeInsets.only(top: 0, bottom: 40.0),
33
+                alignment: Alignment.bottomCenter,
34
+                decoration: BoxDecoration(
35
+                  boxShadow: [
36
+                    BoxShadow(
37
+                      blurRadius: 10, //阴影范围
38
+                      spreadRadius: 0.1, //阴影浓度
39
+                      color: Colors.grey.withOpacity(0.2), //阴影颜色
40
+                    ),
41
+                  ],
42
+                ),
43
+                child: SizedBox(
44
+                  width: 315.w,
45
+                  height: 49.h,
46
+                  child: ElevatedButton(
47
+                    onPressed: () {
48
+                      showDialog(
49
+                          context: context,
50
+                          builder: (context) {
51
+                            return AlertDialog(
52
+                                content: Text("您确定退出登录吗?"),
53
+                                actions: <Widget>[
54
+                                  TextButton(
55
+                                    child: Text("取消"),
56
+                                    onPressed: () {
57
+                                      Navigator.pop(context, 'Cancle');
58
+                                    },
59
+                                  ),
60
+                                  TextButton(
61
+                                      child: Text("确定"),
62
+                                      onPressed: () {
63
+                                        Navigator.pop(context, "Ok");
64
+                                        box.remove('token');
65
+                                        Get.offNamed('/login');
66
+                                      })
67
+                                ]);
68
+                          });
69
+                    },
70
+                    child: const Text(
71
+                      "退出登陆",
72
+                      style: TextStyle(
73
+                          fontSize: 18,
74
+                          color: Colors.black,
75
+                          fontWeight: FontWeight.bold),
76
+                    ),
77
+                    style: ButtonStyle(
78
+                      elevation: MaterialStateProperty.all(0),
79
+                      backgroundColor:
80
+                          MaterialStateProperty.all(const Color(0xFFFFFFFF)),
81
+                      shape: MaterialStateProperty.all(
82
+                          const RoundedRectangleBorder(
83
+                              borderRadius:
84
+                                  BorderRadius.all(Radius.circular(24.4)))),
85
+                    ),
86
+                  ),
87
+                ),
88
+              ),
89
+            ],
90
+          ),
91
+        ],
92
+      ),
93
+    );
94
+  }
95
+}

+ 161
- 0
lib/pages/TabBar/widgets/main/widgets/OtherColumn.dart 查看文件

@@ -0,0 +1,161 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+
5
+class OtherColumn extends StatelessWidget {
6
+  const OtherColumn({Key? key}) : super(key: key);
7
+
8
+  @override
9
+  Widget build(BuildContext context) {
10
+    return Container(
11
+        alignment: Alignment.center,
12
+        width: 345.w,
13
+        margin: EdgeInsets.fromLTRB(0, 15.w, 0, 15.w),
14
+        decoration: BoxDecoration(
15
+          borderRadius: BorderRadius.circular(30),
16
+          color: Colors.white,
17
+          boxShadow: [
18
+            BoxShadow(
19
+              blurRadius: 10, //阴影范围
20
+              spreadRadius: 0.1, //阴影浓度
21
+              color: Colors.grey.withOpacity(0.2), //阴影颜色
22
+            ),
23
+          ],
24
+        ),
25
+        child: Column(
26
+          children: [
27
+            Container(
28
+                margin: EdgeInsets.fromLTRB(0, 30.w, 0, 20.w),
29
+                alignment: Alignment.topLeft,
30
+                decoration: const BoxDecoration(
31
+                    border: Border(
32
+                        left: BorderSide(width: 5, color: Color(0xff000000)
33
+                            // 0x17000000
34
+                            ))),
35
+                child: Padding(
36
+                  padding: EdgeInsets.fromLTRB(12.w, 0, 0, 0),
37
+                  child: Text(
38
+                    '设置',
39
+                    style: TextStyle(
40
+                      color: Color(0xff333333),
41
+                      fontWeight: FontWeight.bold,
42
+                      fontSize: 17.sp,
43
+                    ),
44
+                  ),
45
+                )),
46
+            Container(
47
+              child: Column(
48
+                children: [
49
+                  GestureDetector(
50
+                    onTap: () {
51
+                      Get.toNamed('/aboutUs');
52
+                    },
53
+                    child: Container(
54
+                      height: 45.w,
55
+                      width: 310.w,
56
+                      margin: EdgeInsets.fromLTRB(0, 10.w, 0, 0),
57
+                      decoration: const BoxDecoration(
58
+                          border: Border(
59
+                              bottom: BorderSide(
60
+                                  width: 0.5, color: Color(0x20000000)
61
+                                  // 0x17000000
62
+                                  ))),
63
+                      child: ListTile(
64
+                        contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
65
+                        // 这边使用了contentPadding
66
+                        leading: Image(
67
+                          image: AssetImage('images/aboutUs.png'),
68
+                          width: 18.w,
69
+                          height: 21.w,
70
+                        ),
71
+                        title: Transform(
72
+                          transform: Matrix4.translationValues(-20, 0.0, 0.0),
73
+                          child: Text("关于我们",
74
+                              style: TextStyle(
75
+                                  fontSize: 17.sp, color: Color(0xff333333))),
76
+                        ),
77
+                        trailing: Image(
78
+                          image: AssetImage('images/userRight.png'),
79
+                          width: 10.w,
80
+                          height: 18.w,
81
+                        ),
82
+                      ),
83
+                    ),
84
+                  ),
85
+                  GestureDetector(
86
+                    onTap: () {
87
+                      Get.toNamed('/agreement');
88
+                    },
89
+                    child: Container(
90
+                      margin: EdgeInsets.fromLTRB(0, 10.w, 0, 0),
91
+                      width: 310.w,
92
+                      height: 45.w,
93
+                      decoration: const BoxDecoration(
94
+                          border: Border(
95
+                              bottom: BorderSide(
96
+                                  width: 0.5, color: Color(0x20000000)
97
+                                  // 0x17000000
98
+                                  ))),
99
+                      child: ListTile(
100
+                        contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
101
+                        leading: Image(
102
+                          image: AssetImage('images/versionUpdate.png'),
103
+                          width: 18.w,
104
+                          height: 21.w,
105
+                        ),
106
+                        title: Transform(
107
+                          transform: Matrix4.translationValues(-20, 0.0, 0.0),
108
+                          child: Text("用户协议及隐私政策",
109
+                              style: TextStyle(
110
+                                  fontSize: 17.sp, color: Color(0xff333333))),
111
+                        ),
112
+                        trailing: Image(
113
+                          image: AssetImage('images/userRight.png'),
114
+                          width: 10.w,
115
+                          height: 18.w,
116
+                        ),
117
+                      ),
118
+                    ),
119
+                  ),
120
+                  GestureDetector(
121
+                    onTap: () {
122
+                      Get.toNamed('/feedback');
123
+                    },
124
+                    child: Container(
125
+                      margin: EdgeInsets.fromLTRB(0, 10.w, 0, 20.w),
126
+                      width: 310.w,
127
+                      height: 45.w,
128
+                      decoration: const BoxDecoration(
129
+                          border: Border(
130
+                              bottom: BorderSide(
131
+                                  width: 0.5, color: Color(0x20000000)
132
+                                  // 0x17000000
133
+                                  ))),
134
+                      child: ListTile(
135
+                        contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
136
+                        leading: Image(
137
+                          image: AssetImage('images/feedbacks.png'),
138
+                          width: 18.w,
139
+                          height: 21.w,
140
+                        ),
141
+                        title: Transform(
142
+                          transform: Matrix4.translationValues(-20, 0.0, 0.0),
143
+                          child: Text("意见反馈",
144
+                              style: TextStyle(
145
+                                  fontSize: 17.sp, color: Color(0xff333333))),
146
+                        ),
147
+                        trailing: Image(
148
+                          image: AssetImage('images/userRight.png'),
149
+                          width: 10.w,
150
+                          height: 18.w,
151
+                        ),
152
+                      ),
153
+                    ),
154
+                  ),
155
+                ],
156
+              ),
157
+            )
158
+          ],
159
+        ));
160
+  }
161
+}

+ 99
- 0
lib/pages/TabBar/widgets/main/widgets/UserAddress.dart 查看文件

@@ -0,0 +1,99 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+
5
+class UserAddress extends StatelessWidget {
6
+  const UserAddress({Key? key}) : super(key: key);
7
+
8
+  @override
9
+  Widget build(BuildContext context) {
10
+    return Container(
11
+        alignment: Alignment.center,
12
+        height: 123.w,
13
+        width: 345.w,
14
+        margin: EdgeInsets.fromLTRB(0, 15.w, 0, 15.w),
15
+        decoration: BoxDecoration(
16
+          borderRadius: BorderRadius.circular(30),
17
+          color: Colors.white,
18
+          boxShadow: [
19
+            BoxShadow(
20
+              blurRadius: 10, //阴影范围
21
+              spreadRadius: 0.1, //阴影浓度
22
+              color: Colors.grey.withOpacity(0.2), //阴影颜色
23
+            ),
24
+          ],
25
+        ),
26
+        child: Column(
27
+          children: [
28
+            Container(
29
+                margin: EdgeInsets.fromLTRB(0, 30.w, 0, 20.w),
30
+                alignment: Alignment.topLeft,
31
+                decoration: const BoxDecoration(
32
+                    border: Border(
33
+                        left: BorderSide(width: 5, color: Color(0xff000000)
34
+                            // 0x17000000
35
+                            ))),
36
+                child: Padding(
37
+                  padding: EdgeInsets.fromLTRB(12.w, 0, 0, 0),
38
+                  child: Text(
39
+                    '地址信息',
40
+                    style: TextStyle(
41
+                      color: Color(0xff333333),
42
+                      fontWeight: FontWeight.bold,
43
+                      fontSize: 17.sp,
44
+                    ),
45
+                  ),
46
+                )),
47
+            GestureDetector(
48
+              child: Row(
49
+                mainAxisAlignment: MainAxisAlignment.spaceBetween,
50
+                children: [
51
+                  Container(
52
+                    child: Row(
53
+                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
54
+                      children: [
55
+                        Padding(
56
+                          padding: EdgeInsets.fromLTRB(17.w, 0, 10.w, 0),
57
+                          child: Image(
58
+                            image: AssetImage('images/gpsImgae.png'),
59
+                            width: 12.w,
60
+                          ),
61
+                        ),
62
+                        Container(
63
+                          width: 260,
64
+                          child: Text(
65
+                            '请填写详细地址请填写详细地址请填写详细地址',
66
+                            softWrap: true,
67
+                            maxLines: 1,
68
+                            textAlign: TextAlign.left,
69
+                            overflow: TextOverflow.ellipsis,
70
+                            style: TextStyle(
71
+                              fontWeight: FontWeight.bold,
72
+                              fontSize: 17,
73
+                            ),
74
+                          ),
75
+                        ),
76
+                      ],
77
+                    ),
78
+                  ),
79
+                  Container(
80
+                    alignment: Alignment.center,
81
+                    padding: EdgeInsets.fromLTRB(0, 0, 30.w, 0),
82
+                    child: Text(
83
+                      '>>',
84
+                      style: TextStyle(
85
+                        fontWeight: FontWeight.bold,
86
+                        fontSize: 17,
87
+                      ),
88
+                    ),
89
+                  ),
90
+                ],
91
+              ),
92
+              onTap: () {
93
+                Get.toNamed("/addressList");
94
+              },
95
+            ),
96
+          ],
97
+        ));
98
+  }
99
+}

+ 112
- 0
lib/pages/TabBar/widgets/main/widgets/UserInfo.dart 查看文件

@@ -0,0 +1,112 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+
5
+class UserInfo extends StatelessWidget {
6
+  const UserInfo({Key? key}) : super(key: key);
7
+
8
+  @override
9
+  Widget build(BuildContext context) {
10
+    return Container(
11
+      margin: EdgeInsets.only(top: 20.0, bottom: 0.0),
12
+
13
+      alignment: Alignment.center,
14
+      height: 173.w,
15
+      width: 345.w,
16
+      decoration: BoxDecoration(
17
+        image: const DecorationImage(
18
+          image: AssetImage("images/mineBack.png"),
19
+          fit: BoxFit.cover,
20
+        ),
21
+        borderRadius: BorderRadius.circular(10),
22
+      ),
23
+      child: Stack(
24
+        fit: StackFit.expand,
25
+        children: [
26
+          Positioned(
27
+            top: 0,
28
+            right: 0,
29
+            child: Container(
30
+                alignment: Alignment.center,
31
+                height: 24.w,
32
+                width: 93.w,
33
+                decoration: const BoxDecoration(
34
+                  borderRadius: BorderRadius.only(
35
+                      bottomLeft: Radius.circular(20),
36
+                      topRight: Radius.circular(20)),
37
+                  color: Color(0x30000000),
38
+                ),
39
+                child: GestureDetector(
40
+                  child: const Text(
41
+                    '修改个人信息',
42
+                    style: TextStyle(color: Colors.white),
43
+                  ),
44
+                  onTap: () {
45
+                    Get.toNamed('/userInfo');
46
+                  },
47
+                )),
48
+          ),
49
+          Row(
50
+            children: [
51
+              Column(
52
+                mainAxisAlignment: MainAxisAlignment.center,
53
+                children: [
54
+                  Container(
55
+                    decoration: BoxDecoration(
56
+                      shape: BoxShape.circle,
57
+                      border: Border.all(
58
+                        color: Colors.white,
59
+                        width: 2,
60
+                      ),
61
+                    ),
62
+                    margin: EdgeInsets.fromLTRB(30, 0, 15, 0),
63
+                    alignment: Alignment.center,
64
+                    child: Image.asset(
65
+                      "images/userMoren.png",
66
+                      width: 63.w,
67
+                    ),
68
+                  ),
69
+                ],
70
+              ),
71
+              Container(
72
+                child: Column(
73
+                  mainAxisAlignment: MainAxisAlignment.center,
74
+                  crossAxisAlignment: CrossAxisAlignment.start,
75
+                  children: [
76
+                    Container(
77
+                      margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
78
+                      child: Text(
79
+                        '符西西',
80
+                        style: TextStyle(
81
+                          color: Colors.white,
82
+                          fontSize: 17,
83
+                        ),
84
+                      ),
85
+                    ),
86
+                    Container(
87
+                      margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
88
+                      child: Text(
89
+                        '17775000245',
90
+                        style: TextStyle(
91
+                          color: Colors.white,
92
+                          fontSize: 17,
93
+                        ),
94
+                      ),
95
+                    ),
96
+                    // const Text(
97
+                    //      '点击登陆',
98
+                    //      style: TextStyle(
99
+                    //        color: Colors.white,
100
+                    //        fontSize: 17,
101
+                    //      ),
102
+                    //    ),
103
+                  ],
104
+                ),
105
+              ),
106
+            ],
107
+          ),
108
+        ],
109
+      ),
110
+    );
111
+  }
112
+}

+ 61
- 0
lib/pages/TabBar/widgets/order/index.dart 查看文件

@@ -0,0 +1,61 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+import '../../../../widgets/OrderListCard.dart';
5
+import '../../../orderInfo/index.dart';
6
+
7
+class OrderPage extends StatefulWidget {
8
+  const OrderPage({Key? key}) : super(key: key);
9
+
10
+  @override
11
+  State<OrderPage> createState() => _OrderPageState();
12
+}
13
+
14
+class _OrderPageState extends State<OrderPage> {
15
+  @override
16
+  Widget build(BuildContext context) {
17
+    return ListView(
18
+      children: [
19
+        Container(
20
+          padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
21
+          height: 55.w,
22
+          decoration: BoxDecoration(
23
+            color: Colors.white
24
+          ),
25
+          child: Row(
26
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
27
+
28
+            children: [
29
+              Row(
30
+                children: [
31
+                  Padding(padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
32
+                  child:Image(image: AssetImage('images/ordersListImga.png'),fit: BoxFit.cover,width: 18.w,),
33
+                  ),
34
+                  Text('订单列表',
35
+                    style: TextStyle(
36
+                      color: Color(0xff222222),
37
+                      fontSize: 20.sp,
38
+                      fontWeight: FontWeight.bold
39
+                    ),
40
+                  )
41
+                ],
42
+              ),
43
+            ],
44
+          ),
45
+        ),
46
+ Column(
47
+        mainAxisSize: MainAxisSize.min,
48
+        children: [
49
+          OrderListCard(),
50
+          OrderListCard(),
51
+          OrderListCard(),
52
+          OrderListCard(),
53
+
54
+
55
+        ],
56
+      ),
57
+
58
+    ],
59
+    );
60
+  }
61
+}

+ 1
- 0
lib/pages/home.dart 查看文件

@@ -0,0 +1 @@
1
+// TODO Implement this library.

+ 109
- 0
lib/pages/home2.dart 查看文件

@@ -0,0 +1,109 @@
1
+import 'package:flutter/cupertino.dart';
2
+import 'package:flutter/material.dart';
3
+import 'package:get/get.dart';
4
+import 'package:flutter_screenutil/flutter_screenutil.dart';
5
+
6
+class Home extends StatefulWidget {
7
+  const Home({Key? key}) : super(key: key);
8
+
9
+  @override
10
+  _Home createState() => _Home();
11
+}
12
+
13
+class _Home extends State<Home> {
14
+  List images = [
15
+    ['images/index/index.png', 'images/index/indexActive.png'],
16
+    ['images/index/job.png', 'images/index/jobActive.png'],
17
+    ['images/index/user.png', 'images/index/userActive.png'],
18
+  ];
19
+
20
+  final List _titles = ['首页', '订单列表', '个人中心'];
21
+  int _currentIndex = 0;
22
+  final tabTextStyleSelected =
23
+  TextStyle(color: const Color(0xFF06B03B),fontSize: 15.sp,fontWeight: FontWeight.bold); //选线卡选中字体颜色
24
+  final tabTextStyleNormal =
25
+  TextStyle(color: const Color(0xFF323232),fontSize: 15.sp,fontWeight: FontWeight.bold); //选项卡未选中字体颜色
26
+  int _tabIndex = 0; //选项卡下标
27
+
28
+  var _body = [Text('我是首页'), Text('我是订单列表'), Text('我是个人中心')];
29
+  TextStyle getTabTextStyle(int curIndex) {
30
+    //设置tabbar 选中和未选中的状态文本
31
+    if (curIndex == _tabIndex) {
32
+      return tabTextStyleSelected;
33
+    }
34
+    return tabTextStyleNormal;
35
+  }
36
+
37
+  Image getTabIcon(int curIndex) {
38
+    //设置tabbar选中和未选中的状态图标
39
+    if (curIndex == _tabIndex) {
40
+      return Image.asset(
41
+        images[curIndex][1],
42
+        width: 20.w,
43
+        height: 20.w,
44
+      );
45
+    }
46
+    return Image.asset(
47
+      images[curIndex][0],
48
+      width: 20.w,
49
+      height: 20.w,
50
+    );
51
+  }
52
+
53
+  Image getTabImage(path) {
54
+    return Image.asset(path, width: 26.w, height: 26.w);
55
+  }
56
+
57
+  // 切换底部选项卡,标题的变化设置
58
+  Text getTabTitle(int curIndex) {
59
+    return Text(_titles[curIndex], style: getTabTextStyle(curIndex));
60
+  }
61
+
62
+  @override
63
+  Widget build(BuildContext context) {
64
+    return Scaffold(
65
+      appBar: AppBar(
66
+        elevation: 0,
67
+        centerTitle: true,
68
+        backgroundColor: Colors.white,
69
+        title: Text(
70
+          '首页',
71
+          style: TextStyle(
72
+              color: Colors.black,
73
+              fontSize: 17.sp,
74
+              letterSpacing: 2,
75
+              fontWeight: FontWeight.bold
76
+          ),
77
+        ),
78
+      ),
79
+      body: _body[_tabIndex],
80
+      bottomNavigationBar: Container(
81
+        height: 65.h,
82
+
83
+        child: Row(
84
+          mainAxisAlignment: MainAxisAlignment.spaceAround,
85
+          children: [
86
+            Column(
87
+              children: [
88
+                getTabIcon(0),
89
+                getTabTitle(0)
90
+              ],
91
+            ),
92
+            Column(
93
+              children: [
94
+                getTabIcon(1),
95
+                getTabTitle(1)
96
+              ],
97
+            ),
98
+            Column(
99
+              children: [
100
+                getTabIcon(2),
101
+                getTabTitle(2)
102
+              ],
103
+            ),
104
+          ],
105
+        ),
106
+      ),
107
+    );
108
+  }
109
+}

+ 155
- 0
lib/pages/main/widgets/OtherColumn.dart 查看文件

@@ -0,0 +1,155 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+class OtherColumn extends StatelessWidget {
5
+  const OtherColumn({Key? key}) : super(key: key);
6
+
7
+  @override
8
+  Widget build(BuildContext context) {
9
+    return  Container(
10
+        alignment: Alignment.center,
11
+        width: 345.w,
12
+        margin: EdgeInsets.fromLTRB(0, 15.w, 0, 15.w),
13
+        decoration: BoxDecoration(
14
+          borderRadius: BorderRadius.circular(30),
15
+          color: Colors.white,
16
+          boxShadow: [
17
+            BoxShadow(
18
+              blurRadius: 10, //阴影范围
19
+              spreadRadius: 0.1, //阴影浓度
20
+              color: Colors.grey.withOpacity(0.2), //阴影颜色
21
+            ),
22
+          ],
23
+        ),
24
+        child: Column(
25
+          children: [
26
+            Container(
27
+                margin: EdgeInsets.fromLTRB(0, 30.w, 0, 20.w),
28
+                alignment: Alignment.topLeft,
29
+                decoration: const BoxDecoration(
30
+                    border: Border(
31
+                        left: BorderSide(width: 5, color: Color(0xff000000)
32
+                            // 0x17000000
33
+                            ))),
34
+                child: Padding(
35
+                  padding: EdgeInsets.fromLTRB(12.w, 0, 0, 0),
36
+                  child: Text(
37
+                    '地址信息',
38
+                    style: TextStyle(
39
+                      color: Color(0xff333333),
40
+                      fontWeight: FontWeight.bold,
41
+                      fontSize: 17.sp,
42
+                    ),
43
+                  ),
44
+                )),
45
+            Container(
46
+              child: Column(
47
+                children: [
48
+                  Container(
49
+                    height: 45.w,
50
+                    width: 310.w,
51
+                    margin: EdgeInsets.fromLTRB(0, 10.w, 0, 0),
52
+
53
+                    decoration: const BoxDecoration(
54
+                        border:Border(
55
+                            bottom:
56
+                            BorderSide(width: 0.5, color: Color(0x20000000)
57
+                              // 0x17000000
58
+                            ))
59
+                    ),
60
+
61
+                    child: ListTile(
62
+                      contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
63
+                      // 这边使用了contentPadding
64
+                      leading: Image(
65
+                        image: AssetImage('images/aboutUs.png'),
66
+                        width: 18.w,
67
+                        height: 21.w,
68
+                      ),
69
+                      title: Transform(
70
+                        transform: Matrix4.translationValues(-20, 0.0, 0.0),
71
+                        child: Text("版本更新",
72
+                            style: TextStyle(
73
+                                fontSize: 17.sp, color: Color(0xff333333))),
74
+                      ),
75
+                      trailing: Image(
76
+                        image: AssetImage('images/userRight.png'),
77
+                        width: 10.w,
78
+                        height: 18.w,
79
+                      ),
80
+                    ),
81
+                  ),
82
+                  Container(
83
+                    margin: EdgeInsets.fromLTRB(0, 10.w, 0, 0),
84
+                    width: 310.w,
85
+                    height: 45.w,
86
+                    decoration: const BoxDecoration(
87
+                        border:Border(
88
+                            bottom:
89
+                            BorderSide(width: 0.5, color: Color(0x20000000)
90
+                              // 0x17000000
91
+                            ))
92
+                    ),
93
+
94
+                    child: ListTile(
95
+                      contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
96
+
97
+                      leading: Image(
98
+                        image: AssetImage('images/versionUpdate.png'),
99
+                        width: 18.w,
100
+                        height: 21.w,
101
+                      ),
102
+                      title: Transform(
103
+                        transform: Matrix4.translationValues(-20, 0.0, 0.0),
104
+                        child: Text("用户协议及隐私政策",
105
+                            style: TextStyle(
106
+                                fontSize: 17.sp, color: Color(0xff333333))),
107
+                      ),
108
+                      trailing: Image(
109
+                        image: AssetImage('images/userRight.png'),
110
+                        width: 10.w,
111
+                        height: 18.w,
112
+                      ),
113
+                    ),
114
+                  ),
115
+                  Container(
116
+                    margin: EdgeInsets.fromLTRB(0, 10.w, 0, 20.w),
117
+                    width: 310.w,
118
+                    height: 45.w,
119
+                    decoration: const BoxDecoration(
120
+                        border:Border(
121
+                            bottom:
122
+                            BorderSide(width: 0.5, color: Color(0x20000000)
123
+                              // 0x17000000
124
+                            ))
125
+                    ),
126
+
127
+                    child: ListTile(
128
+                      contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
129
+
130
+                      leading: Image(
131
+                        image: AssetImage('images/feedbacks.png'),
132
+                        width: 18.w,
133
+                        height: 21.w,
134
+                      ),
135
+                      title: Transform(
136
+                        transform: Matrix4.translationValues(-20, 0.0, 0.0),
137
+                        child: Text("意见反馈",
138
+                            style: TextStyle(
139
+                                fontSize: 17.sp, color: Color(0xff333333))),
140
+                      ),
141
+                      trailing: Image(
142
+                        image: AssetImage('images/userRight.png'),
143
+                        width: 10.w,
144
+                        height: 18.w,
145
+                      ),
146
+                    ),
147
+                  ),
148
+
149
+                ],
150
+              ),
151
+            )
152
+          ],
153
+        ));
154
+  }
155
+}

+ 98
- 0
lib/pages/main/widgets/UserAddress.dart 查看文件

@@ -0,0 +1,98 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+class UserAddress extends StatelessWidget {
5
+  const UserAddress({Key? key}) : super(key: key);
6
+
7
+  @override
8
+  Widget build(BuildContext context) {
9
+    return Container(
10
+        alignment: Alignment.center,
11
+        height: 123.w,
12
+        width: 345.w,
13
+        margin: EdgeInsets.fromLTRB(0, 15.w, 0, 15.w),
14
+        decoration: BoxDecoration(
15
+          borderRadius: BorderRadius.circular(30),
16
+          color: Colors.white,
17
+          boxShadow: [
18
+            BoxShadow(
19
+              blurRadius: 10, //阴影范围
20
+              spreadRadius: 0.1, //阴影浓度
21
+              color: Colors.grey.withOpacity(0.2), //阴影颜色
22
+            ),
23
+          ],
24
+        ),
25
+        child: Column(
26
+          children: [
27
+            Container(
28
+                margin: EdgeInsets.fromLTRB(0, 30.w, 0, 20.w),
29
+                alignment: Alignment.topLeft,
30
+                decoration: const BoxDecoration(
31
+                    border: Border(
32
+                        left: BorderSide(width: 5, color: Color(0xff000000)
33
+                            // 0x17000000
34
+                            ))),
35
+                child: Padding(
36
+                  padding: EdgeInsets.fromLTRB(12.w, 0, 0, 0),
37
+                  child: Text(
38
+                    '地址信息',
39
+                    style: TextStyle(
40
+                      color: Color(0xff333333),
41
+                      fontWeight: FontWeight.bold,
42
+                      fontSize: 17.sp,
43
+                    ),
44
+                  ),
45
+                )),
46
+            Row(
47
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
48
+              children: [
49
+                Container(
50
+                  child: Row(
51
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
52
+                    children: [
53
+                      Padding(
54
+                        padding: EdgeInsets.fromLTRB(17.w, 0, 10.w, 0),
55
+                        child: Image(
56
+                          image: AssetImage('images/gpsImgae.png'),
57
+                          width: 12.w,
58
+                        ),
59
+                      ),
60
+                      Container(
61
+                        width: 260,
62
+                        child: GestureDetector(
63
+                          child: Text(
64
+                            '请填写详细地址请填写详细地址请填写详细地址',
65
+                            softWrap: true,
66
+                            maxLines: 1,
67
+                            textAlign: TextAlign.left,
68
+                            overflow: TextOverflow.ellipsis,
69
+                            style: TextStyle(
70
+                              fontWeight: FontWeight.bold,
71
+                              fontSize: 17,
72
+                            ),
73
+                          ),
74
+                          onTap: () {
75
+                            print('修改地址');
76
+                          },
77
+                        ),
78
+                      )
79
+                    ],
80
+                  ),
81
+                ),
82
+                Container(
83
+                  alignment: Alignment.center,
84
+                  padding: EdgeInsets.fromLTRB(0, 0, 30.w, 0),
85
+                  child: Text(
86
+                    '>>',
87
+                    style: TextStyle(
88
+                      fontWeight: FontWeight.bold,
89
+                      fontSize: 17,
90
+                    ),
91
+                  ),
92
+                ),
93
+              ],
94
+            ),
95
+          ],
96
+        ));
97
+  }
98
+}

+ 111
- 0
lib/pages/main/widgets/UserInfo.dart 查看文件

@@ -0,0 +1,111 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+class UserInfo extends StatelessWidget {
5
+  const UserInfo({Key? key}) : super(key: key);
6
+
7
+  @override
8
+  Widget build(BuildContext context) {
9
+    return Container(
10
+      margin: EdgeInsets.only(top: 20.0, bottom: 0.0),
11
+
12
+      alignment: Alignment.center,
13
+      height: 173.w,
14
+      width: 345.w,
15
+      decoration: BoxDecoration(
16
+        image: const DecorationImage(
17
+          image: AssetImage("images/mineBack.png"),
18
+          fit: BoxFit.cover,
19
+        ),
20
+        borderRadius: BorderRadius.circular(10),
21
+      ),
22
+      child: Stack(
23
+        fit: StackFit.expand,
24
+        children: [
25
+          Positioned(
26
+            top: 0,
27
+            right: 0,
28
+            child: Container(
29
+                alignment: Alignment.center,
30
+                height: 24.w,
31
+                width: 93.w,
32
+                decoration: const BoxDecoration(
33
+                  borderRadius: BorderRadius.only(
34
+                      bottomLeft: Radius.circular(20),
35
+                      topRight: Radius.circular(20)),
36
+                  color: Color(0x30000000),
37
+                ),
38
+                child: GestureDetector(
39
+                  child: const Text(
40
+                    '修改个人信息',
41
+                    style: TextStyle(color: Colors.white),
42
+                  ),
43
+                  onTap: () {
44
+                    print('修改个人信息');
45
+                  },
46
+                )),
47
+          ),
48
+          Row(
49
+            children: [
50
+              Column(
51
+                mainAxisAlignment: MainAxisAlignment.center,
52
+                children: [
53
+                  Container(
54
+                    decoration: BoxDecoration(
55
+                      shape: BoxShape.circle,
56
+                      border: Border.all(
57
+                        color: Colors.white,
58
+                        width: 2,
59
+                      ),
60
+                    ),
61
+                    margin: EdgeInsets.fromLTRB(30, 0, 15, 0),
62
+                    alignment: Alignment.center,
63
+                    child: Image.asset(
64
+                      "images/userMoren.png",
65
+                      width: 63.w,
66
+                    ),
67
+                  ),
68
+                ],
69
+              ),
70
+              Container(
71
+                child: Column(
72
+                  mainAxisAlignment: MainAxisAlignment.center,
73
+                  crossAxisAlignment: CrossAxisAlignment.start,
74
+                  children: [
75
+                    Container(
76
+                      margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
77
+                      child: Text(
78
+                        '符西西',
79
+                        style: TextStyle(
80
+                          color: Colors.white,
81
+                          fontSize: 17,
82
+                        ),
83
+                      ),
84
+                    ),
85
+                    Container(
86
+                      margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
87
+                      child: Text(
88
+                        '17775000245',
89
+                        style: TextStyle(
90
+                          color: Colors.white,
91
+                          fontSize: 17,
92
+                        ),
93
+                      ),
94
+                    ),
95
+                    // const Text(
96
+                    //      '点击登陆',
97
+                    //      style: TextStyle(
98
+                    //        color: Colors.white,
99
+                    //        fontSize: 17,
100
+                    //      ),
101
+                    //    ),
102
+                  ],
103
+                ),
104
+              ),
105
+            ],
106
+          ),
107
+        ],
108
+      ),
109
+    );
110
+  }
111
+}

+ 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
+}

+ 22
- 0
lib/widgets/amap/const_config.dart 查看文件

@@ -0,0 +1,22 @@
1
+import 'package:amap_flutter_base/amap_flutter_base.dart';
2
+import 'package:amap_flutter_map/amap_flutter_map.dart';
3
+
4
+class ConstConfig {
5
+  ///配置您申请的apikey,在此处配置之后,可以在初始化[AMapWidget]时,通过`apiKey`属性设置
6
+  ///
7
+  ///注意:使用[AMapWidget]的`apiKey`属性设置的key的优先级高于通过Native配置key的优先级,
8
+  ///使用[AMapWidget]的`apiKey`属性配置后Native配置的key将失效,请根据实际情况选择使用
9
+  static const AMapApiKey amapApiKeys = AMapApiKey(
10
+      androidKey: 'b481b4187e24e625fa0056fd0530e663',
11
+      iosKey: '您申请的iOS平台的key');
12
+
13
+  ///高德隐私合规声明,这里只是示例,实际使用中请按照实际参数设置[AMapPrivacyStatement]的'hasContains''hasShow''hasAgree'这三个参数
14
+  ///
15
+  /// 注意:[AMapPrivacyStatement]的'hasContains''hasShow''hasAgree'这三个参数中有一个为false,高德SDK均不会工作,会造成地图白屏等现象
16
+  ///
17
+  /// 高德开发者合规指南请参考:https://lbs.amap.com/agreement/compliance
18
+  ///
19
+  /// 高德SDK合规使用方案请参考:https://lbs.amap.com/news/sdkhgsy
20
+  static const AMapPrivacyStatement amapPrivacyStatement =
21
+  AMapPrivacyStatement(hasContains: true, hasShow: true, hasAgree: true);
22
+}