李志伟 2 years ago
parent
commit
dba8124760

+ 3
- 7
lib/pages/machinery/detail/widgets/detail.dart View File

5
 import 'package:flutter/material.dart';
5
 import 'package:flutter/material.dart';
6
 import 'package:flutter_screenutil/flutter_screenutil.dart';
6
 import 'package:flutter_screenutil/flutter_screenutil.dart';
7
 import 'package:farmer_client/widgets/ExtendContentList.dart';
7
 import 'package:farmer_client/widgets/ExtendContentList.dart';
8
-import 'package:farmer_client/models/entities/ExtendContent.dart';
9
-import 'package:get/get.dart';
10
 import '../../../../models/entities/CardInfo.dart';
8
 import '../../../../models/entities/CardInfo.dart';
11
 import '../../widgets/summary.dart';
9
 import '../../widgets/summary.dart';
12
 
10
 
20
   return DefLayout(
18
   return DefLayout(
21
       head: CarouselSlider(
19
       head: CarouselSlider(
22
         items: bnnerItem
20
         items: bnnerItem
23
-            .map((item) => Container(
24
-                  child: Center(
25
-                      child: Image.network(item.url.toString(),
26
-                          fit: BoxFit.fitWidth, width: 370.w)),
27
-                ))
21
+            .map((item) => Center(
22
+                child: Image.network(item.url.toString(),
23
+                    fit: BoxFit.fitWidth, width: 370.w)))
28
             .toList(),
24
             .toList(),
29
         options: CarouselOptions(
25
         options: CarouselOptions(
30
           autoPlay: true,
26
           autoPlay: true,

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

1
-import 'package:flutter/foundation.dart';
2
 import 'package:flutter/material.dart';
1
 import 'package:flutter/material.dart';
3
 import 'package:flutter_screenutil/flutter_screenutil.dart';
2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
4
 import 'package:get/get.dart';
3
 import 'package:get/get.dart';
5
-import 'package:get/get_core/src/get_main.dart';
6
-
7
-import '../models/entities/CardInfo.dart';
8
 import '../models/entities/CardListModel.dart';
4
 import '../models/entities/CardListModel.dart';
9
-import '../pages/OrderConfirmation/index.dart';
10
 import '../pages/machinery/detail/index.dart';
5
 import '../pages/machinery/detail/index.dart';
11
-import '../pages/machinery/map/index.dart';
12
 import 'LinearGradientText.dart';
6
 import 'LinearGradientText.dart';
13
 
7
 
14
 class CarsCard extends StatefulWidget {
8
 class CarsCard extends StatefulWidget {

+ 14
- 35
lib/widgets/ExtendContentList.dart View File

1
 import 'package:flutter/widgets.dart';
1
 import 'package:flutter/widgets.dart';
2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3
-import 'package:get/get_rx/src/rx_types/rx_types.dart';
4
-import 'package:get/get_state_manager/src/rx_flutter/rx_obx_widget.dart';
5
-
6
 import '../models/entities/CardInfo.dart';
3
 import '../models/entities/CardInfo.dart';
7
-import '../models/entities/ExtendContent.dart';
8
 
4
 
9
 class ExtendContentList extends StatelessWidget {
5
 class ExtendContentList extends StatelessWidget {
10
   final List<ContentImageList> item;
6
   final List<ContentImageList> item;
23
 
19
 
24
   @override
20
   @override
25
   Widget build(BuildContext context) {
21
   Widget build(BuildContext context) {
26
-    //
27
-    // List<Widget> _widgets = [];
28
-    // Container(
29
-    //   child: item.contentType == "image" ? _image(item.content) : _text(item.content),
30
-    // );
31
-    // for (var i = 0; i < item.length; i += 1) {
32
-    //   if (i != 0 ) {
33
-    //     _widgets.add(SizedBox(height: 20.w,));
34
-    //   }
35
-    //   var item = item[i];
36
-    //   _widgets.add(Container(
37
-    //     child: item.contentType == "image" ? _image(item.content) : _text(item.content),
38
-    //   ));
39
-    // }
40
-
41
-    return Container(
42
-      child: Column(
43
-        children: item.map((item) {
44
-          if (item.contentType != 'image') {
45
-            return Container(
46
-                padding: EdgeInsets.fromLTRB(0, 20, 0, 10),
47
-                width: 344.w,
48
-                child: _text(item.content));
49
-          } else {
50
-            return Container(
51
-              padding: EdgeInsets.fromLTRB(0, 10, 0, 10),
52
-              child: _image(item.content),
53
-            );
54
-          }
55
-        }).toList(),
56
-      ),
22
+    return Column(
23
+      children: item.map((item) {
24
+        if (item.contentType != 'image') {
25
+          return Container(
26
+              padding: EdgeInsets.fromLTRB(0, 20, 0, 10),
27
+              width: 344.w,
28
+              child: _text(item.content));
29
+        } else {
30
+          return Container(
31
+            padding: EdgeInsets.fromLTRB(0, 10, 0, 10),
32
+            child: _image(item.content),
33
+          );
34
+        }
35
+      }).toList(),
57
     );
36
     );
58
   }
37
   }
59
 }
38
 }