Browse Source

Merge branch 'master' of http://git.ycjcjy.com/nanyang/farmer_client

李志伟 3 years ago
parent
commit
63a4190a6b

+ 13
- 6
lib/pages/ArticleInfo/ArticleInfo.dart View File

7
   @override
7
   @override
8
   Widget build(BuildContext context) {
8
   Widget build(BuildContext context) {
9
     return Scaffold(
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,
10
+      resizeToAvoidBottomInset: false,
11
+      appBar: AppBar(
12
+        elevation: 0,
13
+        centerTitle: true,
14
+        backgroundColor: Colors.white,
15
+        title: Text(
16
+          '资讯详情',
17
+          style: TextStyle(
18
+              color: Colors.black,
19
+              fontSize: 17.sp,
20
+              letterSpacing: 2,
21
+              fontWeight: FontWeight.bold),
16
         ),
22
         ),
23
+      ),
17
         body: Container(
24
         body: Container(
18
           padding: EdgeInsets.fromLTRB(15, 30, 15, 50),
25
           padding: EdgeInsets.fromLTRB(15, 30, 15, 50),
19
 
26
 

+ 36
- 0
lib/pages/MoreCars/index.dart View File

1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+
5
+class MoreCars extends StatefulWidget {
6
+  const MoreCars({Key? key}) : super(key: key);
7
+
8
+  @override
9
+  State<MoreCars> createState() => _MoreCarsState();
10
+}
11
+
12
+class _MoreCarsState extends State<MoreCars> {
13
+  @override
14
+  Widget build(BuildContext context) {
15
+    return Scaffold(
16
+      resizeToAvoidBottomInset: false,
17
+      appBar: AppBar(
18
+        elevation: 0,
19
+        centerTitle: true,
20
+        backgroundColor: Colors.white,
21
+        title: Text(
22
+          '更多',
23
+          style: TextStyle(
24
+              color: Colors.black,
25
+              fontSize: 17.sp,
26
+              letterSpacing: 2,
27
+              fontWeight: FontWeight.bold),
28
+        ),
29
+      ),
30
+      body: Container(
31
+        child: Text('wwwwwwwwwww'),
32
+      ),
33
+
34
+    );
35
+  }
36
+}

+ 3
- 1
lib/pages/TabBar/widgets/Information/index.dart View File

3
 import 'package:get/get.dart';
3
 import 'package:get/get.dart';
4
 import 'package:get/get_core/src/get_main.dart';
4
 import 'package:get/get_core/src/get_main.dart';
5
 
5
 
6
+import '../../../ArticleInfo/ArticleInfo.dart';
7
+
6
 class Information extends StatefulWidget {
8
 class Information extends StatefulWidget {
7
   const Information({Key? key}) : super(key: key);
9
   const Information({Key? key}) : super(key: key);
8
 
10
 
64
                 ],
66
                 ],
65
               )),
67
               )),
66
           onTap: () {
68
           onTap: () {
67
-            Get.toNamed('/ArticleInfo');
69
+            Get.to(ArticleInfo());
68
           },
70
           },
69
         ),
71
         ),
70
         GestureDetector(
72
         GestureDetector(

+ 38
- 1
lib/pages/TabBar/widgets/home/index.dart View File

1
+import 'package:carousel_slider/carousel_slider.dart';
1
 import 'package:farmer_client/pages/TabBar/widgets/home/widgets/headers.dart';
2
 import 'package:farmer_client/pages/TabBar/widgets/home/widgets/headers.dart';
2
 import 'package:flutter/material.dart';
3
 import 'package:flutter/material.dart';
3
 import 'package:flutter_screenutil/flutter_screenutil.dart';
4
 import 'package:flutter_screenutil/flutter_screenutil.dart';
4
-
5
+import 'package:get/get.dart';
6
+import 'package:get/get_core/src/get_main.dart';
5
 import '../../../../widgets/CarsCard.dart';
7
 import '../../../../widgets/CarsCard.dart';
6
 import '../../../../widgets/Search.dart';
8
 import '../../../../widgets/Search.dart';
9
+import '../../../MoreCars/index.dart';
7
 
10
 
8
 
11
 
9
 class HomePage extends StatefulWidget {
12
 class HomePage extends StatefulWidget {
14
 }
17
 }
15
 
18
 
16
 class _HomePageState extends State<HomePage> {
19
 class _HomePageState extends State<HomePage> {
20
+  final CarouselController _controller = CarouselController();
21
+  final List<String> imgList = [
22
+    'https://images.unsplash.com/photo-1520342868574-5fa3804e551c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=6ff92caffcdd63681a35134a6770ed3b&auto=format&fit=crop&w=1951&q=80',
23
+    'https://images.unsplash.com/photo-1522205408450-add114ad53fe?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=368f45b0888aeb0b7b08e3a1084d3ede&auto=format&fit=crop&w=1950&q=80',
24
+    'https://images.unsplash.com/photo-1519125323398-675f0ddb6308?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=94a1e718d89ca60a6337a6008341ca50&auto=format&fit=crop&w=1950&q=80',
25
+    'https://images.unsplash.com/photo-1523205771623-e0faa4d2813d?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=89719a0d55dd05e2deae4120227e6efc&auto=format&fit=crop&w=1953&q=80',
26
+    'https://images.unsplash.com/photo-1508704019882-f9cf40e475b4?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=8c6e5e3aba713b17aa1fe71ab4f0ae5b&auto=format&fit=crop&w=1352&q=80',
27
+    'https://images.unsplash.com/photo-1519985176271-adb1088fa94c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=a0c8d632e977f94e5d312d9893258f59&auto=format&fit=crop&w=1355&q=80'
28
+  ];
29
+
17
   @override
30
   @override
18
   Widget build(BuildContext context) {
31
   Widget build(BuildContext context) {
19
     return Container(
32
     return Container(
22
       child: ListView(
35
       child: ListView(
23
         children: [
36
         children: [
24
           headers(),
37
           headers(),
38
+          Container(
39
+            margin: EdgeInsets.fromLTRB(0, 15, 0, 0),
40
+            child: CarouselSlider(
41
+              //API  https://pub.dev/documentation/carousel_slider/latest/carousel_options/CarouselOptions-class.html
42
+              items:imgList
43
+                  .map((item) => Container(
44
+                child: Center(
45
+                    child:
46
+                    Image.network(item, fit: BoxFit.cover, width: 350.w)),
47
+              ))
48
+                  .toList(),
49
+              options: CarouselOptions(
50
+                autoPlay: true,
51
+                enlargeCenterPage: false,//图片中心放大
52
+                viewportFraction: 1,//每个页面应占据的视口部分。默认为 0.8,这意味着每个页面填充 80% 的轮播。
53
+                // aspectRatio: 1.6,//纵横比
54
+                height: 214.w,
55
+                initialPage: 1,//初始页
56
+              ),
57
+            ),
58
+          ),
59
+          
60
+
25
           Container(
61
           Container(
26
             margin: EdgeInsets.fromLTRB(0, 20, 0, 20),
62
             margin: EdgeInsets.fromLTRB(0, 20, 0, 20),
27
             child: Column(
63
             child: Column(
50
                         child:  Text('更多 >>'),
86
                         child:  Text('更多 >>'),
51
                         onTap: (){
87
                         onTap: (){
52
                           print('点我进入农机搜索/更多页');
88
                           print('点我进入农机搜索/更多页');
89
+                          Get.to(MoreCars());
53
                         },
90
                         },
54
                       ),
91
                       ),
55
                     )
92
                     )

+ 0
- 13
lib/pages/TabBar/widgets/home/widgets/ListContent.dart View File

1
-import 'package:flutter/material.dart';
2
-
3
-
4
-class ListContent extends StatelessWidget {
5
-  const ListContent({Key? key}) : super(key: key);
6
-
7
-  @override
8
-  Widget build(BuildContext context) {
9
-    return Container(
10
-      child: Text('test'),
11
-    );
12
-  }
13
-}

+ 2
- 2
lib/pages/TabBar/widgets/home/widgets/headers.dart View File

41
               padding: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
41
               padding: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
42
               width: 260.w,
42
               width: 260.w,
43
               height: 32.w,
43
               height: 32.w,
44
-              decoration: BoxDecoration(
44
+              decoration: const BoxDecoration(
45
                   color: Colors.white
45
                   color: Colors.white
46
               ),
46
               ),
47
               child: GestureDetector(
47
               child: GestureDetector(
49
                     print('点击了搜索');
49
                     print('点击了搜索');
50
                   },
50
                   },
51
                   child: Container(
51
                   child: Container(
52
-                    decoration: BoxDecoration(
52
+                    decoration: const BoxDecoration(
53
                       // color: Colors.red,
53
                       // color: Colors.red,
54
                       color: Color(0x30cccccc),
54
                       color: Color(0x30cccccc),
55
                       borderRadius: BorderRadius.all(Radius.circular(25)),
55
                       borderRadius: BorderRadius.all(Radius.circular(25)),

+ 1
- 0
lib/pages/index.dart View File

3
 export 'splash/splash.dart';
3
 export 'splash/splash.dart';
4
 export 'login/login.dart';
4
 export 'login/login.dart';
5
 export 'machinery/map/index.dart';
5
 export 'machinery/map/index.dart';
6
+export 'machinery/detail/index.dart';
6
 // export 'main/index.dart';
7
 // export 'main/index.dart';

+ 25
- 0
lib/pages/machinery/detail/index.dart View File

1
+
2
+import 'package:flutter/material.dart';
3
+import 'package:get/get.dart';
4
+import 'widgets/detail.dart';
5
+
6
+class MachineryDetailPage extends StatelessWidget {
7
+
8
+  final title = Rx<String>('查看详情');
9
+
10
+  // 响应预约事件
11
+  void handleClick() {
12
+
13
+  }
14
+
15
+  @override
16
+  Widget build(BuildContext context) {
17
+    final appBar = AppBar(title: Obx(() => Text(title.value)), centerTitle: true,);
18
+
19
+    return Scaffold(
20
+      appBar: appBar,
21
+      body: page(context: context, appbarSize: appBar.preferredSize, handleClick: handleClick),
22
+    );
23
+  }
24
+
25
+}

+ 61
- 0
lib/pages/machinery/detail/widgets/detail.dart View File

1
+
2
+import 'package:flutter/widgets.dart';
3
+import 'package:flutter/material.dart';
4
+import 'package:flutter_screenutil/flutter_screenutil.dart';
5
+
6
+import '../../widgets/summary.dart';
7
+
8
+Widget page({ required BuildContext context, required Size appbarSize, required void Function() handleClick}) {
9
+  final _offset = 20.w;
10
+  final width = MediaQuery.of(context).size.width;
11
+  final height = MediaQuery.of(context).size.height
12
+      - appbarSize.height
13
+      - MediaQuery.of(context).padding.top;
14
+  final _bannerHeight = 250.w;
15
+  final img = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg';
16
+
17
+  return Stack(
18
+    alignment: Alignment.topCenter,
19
+      children: [
20
+        // 第一个组件用来撑满全屏
21
+        SizedBox(
22
+          width: width,
23
+          height: height,
24
+        ),
25
+        Positioned(
26
+          left: 0,
27
+          top: 0,
28
+          child: SizedBox(
29
+            height: _bannerHeight,
30
+            child: _banner(img),
31
+          ),
32
+        ),
33
+        Positioned(
34
+          left: 0,
35
+          top: _bannerHeight - _offset,
36
+          child: _content(context),
37
+        ),
38
+      ],
39
+  );
40
+}
41
+
42
+Widget _banner(String imgUrl) {
43
+  return Image.network(imgUrl);
44
+}
45
+
46
+Widget _content(BuildContext context) {
47
+  final _border = 20.w;
48
+  return Container(
49
+    width: MediaQuery.of(context).size.width,
50
+    padding: EdgeInsets.only(top: 45.w, left: 15.w, right: 15.w, bottom: 20.w),
51
+    decoration: BoxDecoration(
52
+      color: Colors.white,
53
+        borderRadius: BorderRadius.vertical(top: Radius.circular(_border))
54
+    ),
55
+    child: Column(
56
+      children: [
57
+        summary(),
58
+      ],
59
+    ),
60
+  );
61
+}

+ 4
- 49
lib/pages/machinery/map/widgets/detail.dart View File

1
 
1
 
2
-
3
 import 'package:flutter/material.dart';
2
 import 'package:flutter/material.dart';
4
 import 'package:flutter/widgets.dart';
3
 import 'package:flutter/widgets.dart';
5
 import 'package:flutter_screenutil/flutter_screenutil.dart';
4
 import 'package:flutter_screenutil/flutter_screenutil.dart';
6
 import 'package:amap_flutter_base/amap_flutter_base.dart';
5
 import 'package:amap_flutter_base/amap_flutter_base.dart';
7
 import 'package:farmer_client/widgets/amap/amap.dart';
6
 import 'package:farmer_client/widgets/amap/amap.dart';
8
 
7
 
8
+import '../../widgets/summary.dart';
9
+
9
 Widget page({ required BuildContext context, required Size appbarSize, required void Function() handleClick}) {
10
 Widget page({ required BuildContext context, required Size appbarSize, required void Function() handleClick}) {
10
-  final _offset = 20.h;
11
+  final _offset = 20.w;
11
   final width = MediaQuery.of(context).size.width;
12
   final width = MediaQuery.of(context).size.width;
12
   final height = MediaQuery.of(context).size.height
13
   final height = MediaQuery.of(context).size.height
13
       - appbarSize.height
14
       - appbarSize.height
63
   return _card(context, Image.network(imgUrl, fit: BoxFit.cover));
64
   return _card(context, Image.network(imgUrl, fit: BoxFit.cover));
64
 }
65
 }
65
 
66
 
66
-Widget _title() {
67
-  return Row(
68
-    children: [
69
-      Expanded(
70
-          child: Text("收割机001--S001",
71
-              style: TextStyle(
72
-                color: Color(0xFF222222),
73
-                fontSize: 18.sp,
74
-              )),
75
-          flex: 1),
76
-      Container(
77
-        width: 100.w,
78
-        alignment: Alignment.centerRight,
79
-        child: Text("450元",
80
-            style: TextStyle(
81
-              color: Color(0xFFB61515),
82
-              fontSize: 22.sp,
83
-            )),
84
-      )
85
-    ],
86
-  );
87
-}
88
-
89
-Widget _desc() {
90
-  return Row(
91
-    children: [
92
-      Icon(Icons.location_on_outlined, size: 16.sp,),
93
-      Expanded(
94
-        flex: 1,
95
-        child: Text("距离当前位置2.3公里 >>", style: TextStyle(color: Color(0xFF222222), fontSize: 15.sp),),
96
-      ),
97
-    ],
98
-  );
99
-}
100
-
101
-Widget _detail() {
102
-  return Container(
103
-    alignment: Alignment.centerLeft,
104
-    child: Text("农机手1的收割机", style: TextStyle(color: Color(0xFF222222), fontSize: 15.sp),),
105
-  );
106
-}
107
 
67
 
108
 Widget _button(void Function() handleClick) {
68
 Widget _button(void Function() handleClick) {
109
   return ElevatedButton(
69
   return ElevatedButton(
130
     child: Column(
90
     child: Column(
131
 
91
 
132
       children: [
92
       children: [
133
-        _title(),
134
-        SizedBox(height: 20.h,),
135
-        _desc(),
136
-        SizedBox(height: 20.h,),
137
-        _detail(),
138
-        SizedBox(height: 20.h,),
93
+        summary(),
139
         _button(handleClick),
94
         _button(handleClick),
140
       ],
95
       ],
141
     ),
96
     ),

+ 90
- 0
lib/pages/machinery/widgets/summary.dart View File

1
+import 'dart:ui' as ui;
2
+import 'package:flutter/material.dart';
3
+import 'package:flutter_screenutil/flutter_screenutil.dart';
4
+
5
+import 'package:farmer_client/widgets/LinearGradientText.dart';
6
+
7
+Widget summary() {
8
+  return Column(
9
+    children: [
10
+      _title(),
11
+      SizedBox(height: 20.w,),
12
+      _desc(),
13
+      SizedBox(height: 20.w,),
14
+      _detail(),
15
+      SizedBox(height: 20.w,),
16
+    ],
17
+  );
18
+}
19
+
20
+Widget _title() {
21
+  return Row(
22
+    children: [
23
+      Expanded(
24
+          child: Text("收割机001--S001",
25
+              style: TextStyle(
26
+                color: Color(0xFF222222),
27
+                fontSize: 18.sp,
28
+                fontWeight: FontWeight.bold,
29
+              )),
30
+          flex: 1),
31
+      Container(
32
+        width: 100.w,
33
+        alignment: Alignment.centerRight,
34
+        child: LinearGradientText(
35
+          colors: const <Color>[
36
+            Color(0xFFFA7878),
37
+            Color(0xFFB61515),
38
+          ],
39
+          child: RichText(
40
+            text: TextSpan(
41
+                children: <InlineSpan>[
42
+                  TextSpan(
43
+                      text: "450",
44
+                      style: TextStyle(
45
+                        fontSize: 22.sp,
46
+                        fontWeight: FontWeight.bold,
47
+                      )),
48
+                  TextSpan(
49
+                      text: "元/",
50
+                      style: TextStyle(
51
+                        fontSize: 22.sp,
52
+                        fontWeight: FontWeight.bold,
53
+                      )),
54
+                  TextSpan(
55
+                      text: "公顷",
56
+                      style: TextStyle(
57
+                        fontSize: 12.sp,
58
+                        fontWeight: FontWeight.bold,
59
+                      )),
60
+                ]
61
+            ),
62
+          ),
63
+
64
+
65
+
66
+
67
+        ),
68
+      )
69
+    ],
70
+  );
71
+}
72
+
73
+Widget _desc() {
74
+  return Row(
75
+    children: [
76
+      Icon(Icons.location_on_outlined, size: 16.sp,),
77
+      Expanded(
78
+        flex: 1,
79
+        child: Text("距离当前位置2.3公里 >>", style: TextStyle(color: Color(0xFF222222), fontSize: 15.sp),),
80
+      ),
81
+    ],
82
+  );
83
+}
84
+
85
+Widget _detail() {
86
+  return Container(
87
+    alignment: Alignment.centerLeft,
88
+    child: Text("农机手1的收割机", style: TextStyle(color: Color(0xFF222222), fontSize: 15.sp),),
89
+  );
90
+}

+ 11
- 7
lib/pages/orderInfo/index.dart View File

6
 
6
 
7
 
7
 
8
 
8
 
9
-
10
 class OrderPageInfo extends StatefulWidget {
9
 class OrderPageInfo extends StatefulWidget {
11
   const OrderPageInfo({Key? key}) : super(key: key);
10
   const OrderPageInfo({Key? key}) : super(key: key);
12
 
11
 
19
   Widget build(BuildContext context) {
18
   Widget build(BuildContext context) {
20
     return Scaffold(
19
     return Scaffold(
21
       resizeToAvoidBottomInset: false,
20
       resizeToAvoidBottomInset: false,
22
-      appBar:  AppBar(
23
-        title:  Text('订单'),
24
-        leading:  Icon(Icons.arrow_back_ios),
25
-        backgroundColor: Color(0xff2b9270),
26
-        // backgroundColor: Colors.transparent,
21
+      appBar: AppBar(
22
+        elevation: 0,
27
         centerTitle: true,
23
         centerTitle: true,
28
-
24
+        backgroundColor: Colors.white,
25
+        title: Text(
26
+          '订单详情',
27
+          style: TextStyle(
28
+              color: Colors.black,
29
+              fontSize: 17.sp,
30
+              letterSpacing: 2,
31
+              fontWeight: FontWeight.bold),
32
+        ),
29
       ),
33
       ),
30
       body:      Column(
34
       body:      Column(
31
         children: [
35
         children: [

+ 1
- 1
lib/routes/pages.dart View File

13
 List<GetPage> pages = [
13
 List<GetPage> pages = [
14
   GetPage(name: '/', page: () =>  Home()),
14
   GetPage(name: '/', page: () =>  Home()),
15
   GetPage(name: '/ArticleInfo', page: () =>  ArticleInfo()),//资讯详情
15
   GetPage(name: '/ArticleInfo', page: () =>  ArticleInfo()),//资讯详情
16
-  GetPage(name: '/splash', page: () => SplashScreen()),//SplashScreen
16
+  GetPage(name: '/splash', page: () => MachineryDetailPage()),//SplashScreen
17
   GetPage(name: '/login', page: () =>  MyRouteLogin()),
17
   GetPage(name: '/login', page: () =>  MyRouteLogin()),
18
   GetPage(name: '/addressList', page: () =>  AddressList()),
18
   GetPage(name: '/addressList', page: () =>  AddressList()),
19
   GetPage(name: '/addAddress', page: () =>  AddAddress()),
19
   GetPage(name: '/addAddress', page: () =>  AddAddress()),

+ 3
- 0
lib/widgets/CarsCard.dart View File

5
 import 'package:get/get_core/src/get_main.dart';
5
 import 'package:get/get_core/src/get_main.dart';
6
 
6
 
7
 import '../pages/OrderConfirmation/index.dart';
7
 import '../pages/OrderConfirmation/index.dart';
8
+import '../pages/machinery/map/index.dart';
8
 
9
 
9
 // class CarItem {
10
 // class CarItem {
10
 //   late String name;
11
 //   late String name;
90
                       onPressed: () {
91
                       onPressed: () {
91
                         Get.to(OrderConfirmation());
92
                         Get.to(OrderConfirmation());
92
                         print('点我去预约');
93
                         print('点我去预约');
94
+
93
                       },
95
                       },
94
                       child: const Text(
96
                       child: const Text(
95
                         "预约",
97
                         "预约",
143
                             ),
145
                             ),
144
                             onTap: () {
146
                             onTap: () {
145
                               print('进入地图');
147
                               print('进入地图');
148
+                              Get.to(MachineryMapPage());
146
                             },
149
                             },
147
                           )
150
                           )
148
                         ],
151
                         ],

+ 31
- 0
lib/widgets/LinearGradientText.dart View File

1
+
2
+import 'package:flutter/widgets.dart';
3
+
4
+class LinearGradientText extends StatelessWidget {
5
+  final AlignmentGeometry begin;
6
+  final AlignmentGeometry end;
7
+  final List<Color> colors;
8
+  Widget child;
9
+
10
+  LinearGradientText({
11
+    Key? key,
12
+    required this.colors,
13
+    required this.child,
14
+    this.begin = Alignment.topCenter,
15
+    this.end = Alignment.bottomCenter,
16
+  }) : super(key: key);
17
+
18
+  Shader _linearGradient(Rect bounds) {
19
+    Gradient gradient = LinearGradient(colors: colors, begin: begin, end: end);
20
+    return gradient.createShader(bounds);
21
+  }
22
+
23
+  @override
24
+  Widget build(BuildContext context) {
25
+    return ShaderMask(
26
+      blendMode: BlendMode.srcIn,
27
+      shaderCallback: (bounds) => _linearGradient(bounds),
28
+      child: child,
29
+    );
30
+  }
31
+}

+ 179
- 180
lib/widgets/OrderInfoCard.dart View File

7
   @override
7
   @override
8
   Widget build(BuildContext context) {
8
   Widget build(BuildContext context) {
9
     return Container(
9
     return Container(
10
-      width: 345.w,
11
-      height: 484.5.h,
12
-      margin: EdgeInsets.fromLTRB(15.w, 17.w, 15.w, 0),
13
-      decoration: BoxDecoration(
14
-        color: Colors.white,
15
-        //设置四周圆角 角度
16
-        borderRadius: BorderRadius.all(Radius.circular(2.0)),
17
-        //设置四周边框
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
-        crossAxisAlignment: CrossAxisAlignment.start,
28
-        children: [
29
-          Container(
30
-              margin: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
31
-              child: Column(
32
-                crossAxisAlignment: CrossAxisAlignment.start,
33
-                children: [
34
-                  Container(
35
-                    padding: EdgeInsets.fromLTRB(0, 15, 0, 20),
36
-                    width: 314.w,
37
-                    decoration: const BoxDecoration(
38
-                        border: Border(
39
-                            bottom:
40
-                                BorderSide(width: 0.5, color: Color(0x20000000)
41
-                                    // 0x17000000
42
-                                    ))),
43
-                    child: RichText(
44
-                      text: const TextSpan(children: <InlineSpan>[
45
-                        TextSpan(
46
-                            text: '订单编号:',
47
-                            style: TextStyle(
48
-                                color: Color(0xff666666),
49
-                                fontSize: 16,
50
-                                fontWeight: FontWeight.bold)),
51
-                        TextSpan(
52
-                            text: 'XUHUI12345',
53
-                            style: TextStyle(
54
-                                color: Color(0xff222222),
55
-                                fontSize: 16,
56
-                                fontWeight: FontWeight.bold)),
57
-                      ]),
10
+        width: 345.w,
11
+        height: 484.5.h,
12
+        margin: EdgeInsets.fromLTRB(15.w, 17.w, 15.w, 0),
13
+        decoration: BoxDecoration(
14
+          color: Colors.white,
15
+          //设置四周圆角 角度
16
+          borderRadius: BorderRadius.all(Radius.circular(2.0)),
17
+          //设置四周边框
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
+          crossAxisAlignment: CrossAxisAlignment.start,
28
+          children: [
29
+            Container(
30
+                margin: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
31
+                child: Column(
32
+                  crossAxisAlignment: CrossAxisAlignment.start,
33
+                  children: [
34
+                    Container(
35
+                      padding: EdgeInsets.fromLTRB(0, 15, 0, 20),
36
+                      width: 314.w,
37
+                      decoration: const BoxDecoration(
38
+                          border: Border(
39
+                              bottom: BorderSide(
40
+                                  width: 0.5, color: Color(0x20000000)
41
+                                  // 0x17000000
42
+                                  ))),
43
+                      child: RichText(
44
+                        text: const TextSpan(children: <InlineSpan>[
45
+                          TextSpan(
46
+                              text: '订单编号:',
47
+                              style: TextStyle(
48
+                                  color: Color(0xff666666),
49
+                                  fontSize: 16,
50
+                                  fontWeight: FontWeight.bold)),
51
+                          TextSpan(
52
+                              text: 'XUHUI12345',
53
+                              style: TextStyle(
54
+                                  color: Color(0xff222222),
55
+                                  fontSize: 16,
56
+                                  fontWeight: FontWeight.bold)),
57
+                        ]),
58
+                      ),
58
                     ),
59
                     ),
59
-                  ),
60
-                  Padding(
61
-                    padding: EdgeInsets.fromLTRB(0, 20, 0, 15),
62
-                    child: RichText(
63
-                      text: const TextSpan(children: <InlineSpan>[
64
-                        TextSpan(
65
-                            text: '农机名称:',
66
-                            style: TextStyle(
67
-                                color: Color(0xff666666),
68
-                                fontSize: 16,
69
-                                fontWeight: FontWeight.bold)),
70
-                        TextSpan(
71
-                            text: '老李家收割机MVGV-005',
72
-                            style: TextStyle(
73
-                                color: Color(0xff222222),
74
-                                fontSize: 16,
75
-                                fontWeight: FontWeight.bold)),
76
-                      ]),
60
+                    Padding(
61
+                      padding: EdgeInsets.fromLTRB(0, 20, 0, 15),
62
+                      child: RichText(
63
+                        text: const TextSpan(children: <InlineSpan>[
64
+                          TextSpan(
65
+                              text: '农机名称:',
66
+                              style: TextStyle(
67
+                                  color: Color(0xff666666),
68
+                                  fontSize: 16,
69
+                                  fontWeight: FontWeight.bold)),
70
+                          TextSpan(
71
+                              text: '老李家收割机MVGV-005',
72
+                              style: TextStyle(
73
+                                  color: Color(0xff222222),
74
+                                  fontSize: 16,
75
+                                  fontWeight: FontWeight.bold)),
76
+                        ]),
77
+                      ),
77
                     ),
78
                     ),
78
-                  ),
79
-                  Padding(
80
-                    padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
81
-                    child: RichText(
82
-                      text: const TextSpan(children: <InlineSpan>[
83
-                        TextSpan(
84
-                            text: '作业面积:',
85
-                            style: TextStyle(
86
-                                color: Color(0xff666666),
87
-                                fontSize: 16,
88
-                                fontWeight: FontWeight.bold)),
89
-                        TextSpan(
90
-                            text: '1',
91
-                            style: TextStyle(
92
-                                color: Color(0xff222222),
93
-                                fontSize: 16,
94
-                                fontWeight: FontWeight.bold)),
95
-                      ]),
79
+                    Padding(
80
+                      padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
81
+                      child: RichText(
82
+                        text: const TextSpan(children: <InlineSpan>[
83
+                          TextSpan(
84
+                              text: '作业面积:',
85
+                              style: TextStyle(
86
+                                  color: Color(0xff666666),
87
+                                  fontSize: 16,
88
+                                  fontWeight: FontWeight.bold)),
89
+                          TextSpan(
90
+                              text: '1',
91
+                              style: TextStyle(
92
+                                  color: Color(0xff222222),
93
+                                  fontSize: 16,
94
+                                  fontWeight: FontWeight.bold)),
95
+                        ]),
96
+                      ),
96
                     ),
97
                     ),
97
-                  ),
98
-                  Padding(
99
-                    padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
100
-                    child: RichText(
101
-                      text: const TextSpan(children: <InlineSpan>[
102
-                        TextSpan(
103
-                            text: '需求时间:',
104
-                            style: TextStyle(
105
-                                color: Color(0xff666666),
106
-                                fontSize: 16,
107
-                                fontWeight: FontWeight.bold)),
108
-                        TextSpan(
109
-                            text: '2018-08-21',
110
-                            style: TextStyle(
111
-                                color: Color(0xff222222),
112
-                                fontSize: 16,
113
-                                fontWeight: FontWeight.bold)),
114
-                      ]),
98
+                    Padding(
99
+                      padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
100
+                      child: RichText(
101
+                        text: const TextSpan(children: <InlineSpan>[
102
+                          TextSpan(
103
+                              text: '需求时间:',
104
+                              style: TextStyle(
105
+                                  color: Color(0xff666666),
106
+                                  fontSize: 16,
107
+                                  fontWeight: FontWeight.bold)),
108
+                          TextSpan(
109
+                              text: '2018-08-21',
110
+                              style: TextStyle(
111
+                                  color: Color(0xff222222),
112
+                                  fontSize: 16,
113
+                                  fontWeight: FontWeight.bold)),
114
+                        ]),
115
+                      ),
115
                     ),
116
                     ),
116
-                  ),
117
-                  Padding(
118
-                    padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
119
-                    child: RichText(
120
-                      text: const TextSpan(children: <InlineSpan>[
121
-                        TextSpan(
122
-                            text: '下单时间:',
123
-                            style: TextStyle(
124
-                                color: Color(0xff666666),
125
-                                fontSize: 16,
126
-                                fontWeight: FontWeight.bold)),
127
-                        TextSpan(
128
-                            text: '2022-04-13',
129
-                            style: TextStyle(
130
-                                color: Color(0xff222222),
131
-                                fontSize: 16,
132
-                                fontWeight: FontWeight.bold)),
133
-                      ]),
117
+                    Padding(
118
+                      padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
119
+                      child: RichText(
120
+                        text: const TextSpan(children: <InlineSpan>[
121
+                          TextSpan(
122
+                              text: '下单时间:',
123
+                              style: TextStyle(
124
+                                  color: Color(0xff666666),
125
+                                  fontSize: 16,
126
+                                  fontWeight: FontWeight.bold)),
127
+                          TextSpan(
128
+                              text: '2022-04-13',
129
+                              style: TextStyle(
130
+                                  color: Color(0xff222222),
131
+                                  fontSize: 16,
132
+                                  fontWeight: FontWeight.bold)),
133
+                        ]),
134
+                      ),
134
                     ),
135
                     ),
135
-                  ),
136
-                  Padding(
137
-                    padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
138
-                    child: RichText(
139
-                      text: TextSpan(children: <InlineSpan>[
140
-                        TextSpan(
141
-                            text: '订单状态:',
142
-                            style: TextStyle(
143
-                                color: Color(0xff666666),
144
-                                fontSize: 16,
145
-                                fontWeight: FontWeight.bold)),
146
-                        TextSpan(
147
-                            text: '待付款',
148
-                            style: TextStyle(
149
-                                color: Color(0xff51D4FF),
150
-                                fontSize: 16,
151
-                                fontWeight: FontWeight.bold)),
152
-                      ]),
136
+                    Padding(
137
+                      padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
138
+                      child: RichText(
139
+                        text: TextSpan(children: <InlineSpan>[
140
+                          TextSpan(
141
+                              text: '订单状态:',
142
+                              style: TextStyle(
143
+                                  color: Color(0xff666666),
144
+                                  fontSize: 16,
145
+                                  fontWeight: FontWeight.bold)),
146
+                          TextSpan(
147
+                              text: '待付款',
148
+                              style: TextStyle(
149
+                                  color: Color(0xff51D4FF),
150
+                                  fontSize: 16,
151
+                                  fontWeight: FontWeight.bold)),
152
+                        ]),
153
+                      ),
153
                     ),
154
                     ),
154
-                  ),
155
-                  Container(
156
-                      padding: EdgeInsets.fromLTRB(0, 20, 0, 0),
157
-                      width: 314.w,
158
-                      decoration: const BoxDecoration(
159
-                          border: Border(
160
-                              top: BorderSide(
161
-                                  width: 0.8, color: Color(0x20000000)
162
-                                  // 0x17000000
163
-                                  ))),
164
-                      child: Column(
165
-                        children: [
166
-                          Row(
167
-                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
168
-                            children: [
169
-                              Text('费用:',
170
-                                  style: TextStyle(
171
-                                      color: Color(0xff666666),
172
-                                      fontSize: 16,
173
-                                      fontWeight: FontWeight.bold)),
174
-                              Text('8880',
175
-                                  style: TextStyle(
176
-                                      color: Color(0xffB61515),
177
-                                      fontSize: 16,
178
-                                      fontWeight: FontWeight.bold)),
179
-                            ],
180
-                          ),
181
-                          Padding(padding: EdgeInsets.fromLTRB(0, 30, 0, 0),
182
-                            child:  Row(
155
+                    Container(
156
+                        padding: EdgeInsets.fromLTRB(0, 20, 0, 0),
157
+                        width: 314.w,
158
+                        decoration: const BoxDecoration(
159
+                            border: Border(
160
+                                top: BorderSide(
161
+                                    width: 0.8, color: Color(0x20000000)
162
+                                    // 0x17000000
163
+                                    ))),
164
+                        child: Column(
165
+                          children: [
166
+                            Row(
183
                               mainAxisAlignment: MainAxisAlignment.spaceBetween,
167
                               mainAxisAlignment: MainAxisAlignment.spaceBetween,
184
                               children: [
168
                               children: [
185
-                                Text('状态:',
169
+                                Text('费用:',
186
                                     style: TextStyle(
170
                                     style: TextStyle(
187
                                         color: Color(0xff666666),
171
                                         color: Color(0xff666666),
188
                                         fontSize: 16,
172
                                         fontSize: 16,
189
                                         fontWeight: FontWeight.bold)),
173
                                         fontWeight: FontWeight.bold)),
190
-                                Text('待付款',
174
+                                Text('8880',
191
                                     style: TextStyle(
175
                                     style: TextStyle(
192
-                                        color: Color(0xff51D4FF),
176
+                                        color: Color(0xffB61515),
193
                                         fontSize: 16,
177
                                         fontSize: 16,
194
                                         fontWeight: FontWeight.bold)),
178
                                         fontWeight: FontWeight.bold)),
195
                               ],
179
                               ],
196
                             ),
180
                             ),
197
-
198
-                          ),
199
-
200
-                        ],
201
-                      )),
202
-                ],
203
-              )),
204
-
205
-        ],
206
-      ),
181
+                            Padding(
182
+                              padding: EdgeInsets.fromLTRB(0, 30, 0, 0),
183
+                              child: Row(
184
+                                mainAxisAlignment:
185
+                                    MainAxisAlignment.spaceBetween,
186
+                                children: [
187
+                                  Text('状态:',
188
+                                      style: TextStyle(
189
+                                          color: Color(0xff666666),
190
+                                          fontSize: 16,
191
+                                          fontWeight: FontWeight.bold)),
192
+                                  Text('待付款',
193
+                                      style: TextStyle(
194
+                                          color: Color(0xff51D4FF),
195
+                                          fontSize: 16,
196
+                                          fontWeight: FontWeight.bold)),
197
+                                ],
198
+                              ),
199
+                            ),
200
+                          ],
201
+                        )),
202
+                  ],
203
+                )),
204
+          ],
205
+        ),
207
 
206
 
208
     );
207
     );
209
   }
208
   }

+ 6
- 0
lib/widgets/OrderListCard.dart View File

1
 import 'package:flutter/material.dart';
1
 import 'package:flutter/material.dart';
2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+
5
+import '../pages/OrderConfirmation/index.dart';
6
+import '../pages/orderInfo/index.dart';
7
+import 'OrderInfoCard.dart';
3
 
8
 
4
 class OrderListCard extends StatelessWidget {
9
 class OrderListCard extends StatelessWidget {
5
   const OrderListCard({Key? key}) : super(key: key);
10
   const OrderListCard({Key? key}) : super(key: key);
74
                             )),
79
                             )),
75
                         onTap: () {
80
                         onTap: () {
76
                           print('进入详情');
81
                           print('进入详情');
82
+                          Get.to(OrderPageInfo());
77
                         },
83
                         },
78
                       )
84
                       )
79
                     ],
85
                     ],

+ 7
- 0
pubspec.lock View File

64
       url: "https://pub.flutter-io.cn"
64
       url: "https://pub.flutter-io.cn"
65
     source: hosted
65
     source: hosted
66
     version: "1.0.0"
66
     version: "1.0.0"
67
+  carousel_slider:
68
+    dependency: "direct main"
69
+    description:
70
+      name: carousel_slider
71
+      url: "https://pub.dartlang.org"
72
+    source: hosted
73
+    version: "4.0.0"
67
   characters:
74
   characters:
68
     dependency: transitive
75
     dependency: transitive
69
     description:
76
     description:

+ 1
- 0
pubspec.yaml View File

46
   fluttertoast: ^8.0.9
46
   fluttertoast: ^8.0.9
47
   location: ^4.3.0
47
   location: ^4.3.0
48
   amap_flutter_map: ^3.0.0
48
   amap_flutter_map: ^3.0.0
49
+  carousel_slider: ^4.0.0
49
 
50
 
50
 
51
 
51
 
52