李志伟 3 vuotta sitten
vanhempi
commit
5ce3b59e9a

+ 1
- 1
lib/pages/MoreCars/index.dart Näytä tiedosto

@@ -1,10 +1,10 @@
1
+import 'package:farmer_client/pages/home/widgets/home/widgets/headers.dart';
1 2
 import 'package:flutter/material.dart';
2 3
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3 4
 import 'package:get/get.dart';
4 5
 
5 6
 import '../../widgets/CarsCard.dart';
6 7
 import '../../widgets/Search.dart';
7
-import '../TabBar/widgets/home/widgets/headers.dart';
8 8
 
9 9
 class MoreCars extends StatefulWidget {
10 10
   const MoreCars({Key? key}) : super(key: key);

+ 0
- 133
lib/pages/TabBar/index.dart Näytä tiedosto

@@ -1,133 +0,0 @@
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
-}

+ 0
- 125
lib/pages/TabBar/widgets/Information/index.dart Näytä tiedosto

@@ -1,125 +0,0 @@
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
-}

+ 0
- 140
lib/pages/TabBar/widgets/home/index.dart Näytä tiedosto

@@ -1,140 +0,0 @@
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/CardInfo.dart';
9
-import '../../../../services/homeAPI.dart';
10
-import '../../../../widgets/CarsCard.dart';
11
-import 'package:farmer_client/models/entities/Banners.dart';
12
-import '../../../MoreCars/index.dart';
13
-
14
-class HomePage extends StatefulWidget {
15
-  const HomePage({Key? key, }) : super(key: key);
16
-
17
-
18
-  @override
19
-  _HomePageState createState() => _HomePageState();
20
-}
21
-
22
-
23
-class _HomePageState extends State<HomePage> {
24
-  final CarouselController _controller = CarouselController();
25
-  List<Banners> bannerList = [];
26
-
27
-  List<CardInfo> machineryLists = [];
28
-
29
-
30
-
31
-
32
-  @override
33
-  void initState() {
34
-    super.initState();
35
-    // final location = AppController.t.location;
36
-    // print('location+$location');
37
-
38
-    getHomeBanner('banner').then((value) {
39
-      setState(() {
40
-        value.forEach((item) {
41
-          bannerList.add(Banners.fromJson(item));
42
-        });
43
-      });
44
-    });
45
-
46
-    getMachinery('112.087433,32.687692').then((value) {
47
-      setState(() {
48
-        value['records'].forEach((item) {
49
-          machineryLists.add(CardInfo.fromJson(item));
50
-        });
51
-      });
52
-    });
53
-  }
54
-
55
-  @override
56
-  Widget build(BuildContext context) {
57
-
58
-    return Container(
59
-      alignment: Alignment.center,
60
-      padding: EdgeInsets.fromLTRB(15.w, 0, 15.w, 0),
61
-      child: ListView(
62
-        children: [
63
-          Container(
64
-            width: 20.w,
65
-            child: TypeHeader(
66
-              type: true,
67
-            ),
68
-          ),
69
-          Container(
70
-            margin: EdgeInsets.fromLTRB(0, 15, 0, 0),
71
-            child:
72
-                CarouselSlider(
73
-              items: bannerList.map((item) => Container(
74
-                    child: Center(
75
-                        child: Image.network(item.thumb.toString(),
76
-                            fit: BoxFit.cover, width: 350.w)),
77
-                  )).toList(),
78
-              options: CarouselOptions(
79
-                autoPlay: true,
80
-                enlargeCenterPage: false, //图片中心放大
81
-                viewportFraction: 1, //每个页面应占据的视口部分。默认为 0.8,这意味着每个页面填充 80% 的轮播。
82
-                // aspectRatio: 1.6,//纵横比
83
-                height: 214.w,
84
-                initialPage: 1, //初始页
85
-              ),
86
-            ),
87
-          ),
88
-          Container(
89
-              margin: EdgeInsets.fromLTRB(0, 20, 0, 20),
90
-              child: Column(
91
-                children: [
92
-                  Row(
93
-                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
94
-                    children: [
95
-                      Container(
96
-                        child: Row(
97
-                          children: [
98
-                            Padding(
99
-                              padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
100
-                              child: Image(
101
-                                image:
102
-                                    AssetImage('images/icons/carsListImga.png'),
103
-                                fit: BoxFit.cover,
104
-                                width: 20.w,
105
-                              ),
106
-                            ),
107
-                            Text(
108
-                              '农机列表',
109
-                              style: TextStyle(
110
-                                  color: Color(0xff222222),
111
-                                  fontSize: 20.sp,
112
-                                  fontWeight: FontWeight.bold),
113
-                            )
114
-                          ],
115
-                        ),
116
-                      ),
117
-                      Container(
118
-                        child: GestureDetector(
119
-                          child: Text('更多 >>'),
120
-                          onTap: () {
121
-                            print('点我进入农机搜索/更多页');
122
-                            Get.to(MoreCars());
123
-                          },
124
-                        ),
125
-                      )
126
-                    ],
127
-                  ),
128
-            Column(
129
-              children: machineryLists.map((item) =>CarsCard(item:item)).toList(),
130
-            )
131
-
132
-
133
-
134
-                ],
135
-              )),
136
-        ],
137
-      ),
138
-    );
139
-  }
140
-}

+ 0
- 103
lib/pages/TabBar/widgets/home/widgets/headers.dart Näytä tiedosto

@@ -1,103 +0,0 @@
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
-}

+ 0
- 95
lib/pages/TabBar/widgets/main/index.dart Näytä tiedosto

@@ -1,95 +0,0 @@
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
-}

+ 0
- 161
lib/pages/TabBar/widgets/main/widgets/OtherColumn.dart Näytä tiedosto

@@ -1,161 +0,0 @@
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
-}

+ 0
- 99
lib/pages/TabBar/widgets/main/widgets/UserAddress.dart Näytä tiedosto

@@ -1,99 +0,0 @@
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
-}

+ 0
- 112
lib/pages/TabBar/widgets/main/widgets/UserInfo.dart Näytä tiedosto

@@ -1,112 +0,0 @@
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
-}

+ 0
- 74
lib/pages/TabBar/widgets/order/index.dart Näytä tiedosto

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

+ 1
- 1
lib/pages/home/widgets/home/index.dart Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 import 'package:carousel_slider/carousel_slider.dart';
2
-import 'package:farmer_client/pages/TabBar/widgets/home/widgets/headers.dart';
2
+import 'package:farmer_client/pages/home/widgets/home/widgets/headers.dart';
3 3
 import 'package:flutter/material.dart';
4 4
 import 'package:flutter_screenutil/flutter_screenutil.dart';
5 5
 import 'package:get/get.dart';

+ 1
- 1
lib/pages/login/login.dart Näytä tiedosto

@@ -1,6 +1,7 @@
1 1
 import 'dart:async';
2 2
 import 'dart:ffi';
3 3
 import 'package:farmer_client/models/app.dart';
4
+import 'package:farmer_client/pages/home/index.dart';
4 5
 import 'package:fluttertoast/fluttertoast.dart';
5 6
 import 'package:flutter/gestures.dart';
6 7
 import 'package:flutter/material.dart';
@@ -10,7 +11,6 @@ import 'package:get/get.dart';
10 11
 import '../../models/entities/person.dart';
11 12
 import '../../services/user.dart';
12 13
 import '../../widgets/Cell.dart';
13
-import '../TabBar/index.dart';
14 14
 
15 15
 
16 16
 class MyRouteLogin extends StatefulWidget {