李志伟 3 years ago
parent
commit
54246c33c2
50 changed files with 248 additions and 236 deletions
  1. 1
    2
      lib/models/Store.dart
  2. 2
    4
      lib/models/User.dart
  3. 2
    1
      lib/models/app.dart
  4. 4
    4
      lib/models/bankCardList.dart
  5. 4
    4
      lib/models/bankPickerList.dart
  6. 1
    1
      lib/models/entities/BankCard.dart
  7. 8
    8
      lib/models/entities/Banner.dart
  8. 9
    10
      lib/models/entities/ExtendContent.dart
  9. 21
    22
      lib/models/entities/Log.dart
  10. 1
    2
      lib/models/entities/PagedResult.dart
  11. 0
    2
      lib/models/index.dart
  12. 2
    2
      lib/pages/addBankCard/index.dart
  13. 2
    2
      lib/pages/bankList/index.dart
  14. 1
    1
      lib/pages/bankList/widget/BankCard.dart
  15. 1
    1
      lib/pages/home/index.dart
  16. 2
    3
      lib/pages/home/widgets/headers.dart
  17. 3
    2
      lib/pages/machineryDetail/index.dart
  18. 1
    2
      lib/pages/machineryList/index.dart
  19. 0
    1
      lib/pages/machineryMap/index.dart
  20. 2
    0
      lib/pages/main/index.dart
  21. 0
    1
      lib/routes/index.dart
  22. 1
    2
      lib/routes/middleWares.dart
  23. 8
    9
      lib/routes/pages.dart
  24. 3
    4
      lib/services/banner.dart
  25. 4
    4
      lib/services/feedback.dart
  26. 3
    2
      lib/services/job.dart
  27. 6
    9
      lib/services/order.dart
  28. 4
    6
      lib/theme.dart
  29. 0
    2
      lib/utils/Request.dart
  30. 2
    3
      lib/utils/amap/const_config.dart
  31. 4
    4
      lib/utils/location.dart
  32. 2
    3
      lib/utils/timer.dart
  33. 20
    22
      lib/widgets/Cell.dart
  34. 18
    0
      lib/widgets/Copyright.dart
  35. 7
    4
      lib/widgets/GradientButton.dart
  36. 5
    5
      lib/widgets/Modal.dart
  37. 7
    3
      lib/widgets/MoneyCard/index.dart
  38. 1
    1
      lib/widgets/MyButton/entities/Gradient.dart
  39. 6
    8
      lib/widgets/MyButton/index.dart
  40. 2
    2
      lib/widgets/MyCard/entities/ItemColor.dart
  41. 9
    5
      lib/widgets/MyCard/index.dart
  42. 6
    7
      lib/widgets/MyCard/widgets/CardCell.dart
  43. 1
    3
      lib/widgets/MyCell/index.dart
  44. 14
    19
      lib/widgets/MyDialog.dart
  45. 2
    3
      lib/widgets/MyTitle/index.dart
  46. 2
    5
      lib/widgets/NullCard.dart
  47. 6
    8
      lib/widgets/layout/BasicPage.dart
  48. 24
    6
      lib/widgets/layout/barList.dart
  49. 8
    9
      lib/widgets/layout/bottomBar/BottomBar.dart
  50. 6
    3
      lib/widgets/layout/bottomBar/item.dart

+ 1
- 2
lib/models/Store.dart View File

1
-
2
 import '../models/User.dart';
1
 import '../models/User.dart';
3
 import 'package:get/get.dart';
2
 import 'package:get/get.dart';
4
 
3
 
8
   init() {
7
   init() {
9
     Get.put(User(), tag: 'user');
8
     Get.put(User(), tag: 'user');
10
   }
9
   }
11
-}
10
+}

+ 2
- 4
lib/models/User.dart View File

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

+ 2
- 1
lib/models/app.dart View File

44
           'path': '/v3/geocode/regeo'
44
           'path': '/v3/geocode/regeo'
45
         }).then((value) {
45
         }).then((value) {
46
           //json字符串转Map对象
46
           //json字符串转Map对象
47
-          address({'address':jsonDecode(value)['regeocode']['formatted_address']});
47
+          address(
48
+              {'address': jsonDecode(value)['regeocode']['formatted_address']});
48
         });
49
         });
49
       }
50
       }
50
     }
51
     }

+ 4
- 4
lib/models/bankCardList.dart View File

1
 import 'package:get/get.dart';
1
 import 'package:get/get.dart';
2
 import 'package:worker_client/models/entities/BankCard.dart';
2
 import 'package:worker_client/models/entities/BankCard.dart';
3
 
3
 
4
-class BankCardListController extends GetxController{
5
-  static BankCardListController t=Get.find();
6
-  final bankCardList=Rx<List<BankCardModel>>([]);
7
-}
4
+class BankCardListController extends GetxController {
5
+  static BankCardListController t = Get.find();
6
+  final bankCardList = Rx<List<BankCardModel>>([]);
7
+}

+ 4
- 4
lib/models/bankPickerList.dart View File

1
 import 'package:get/get.dart';
1
 import 'package:get/get.dart';
2
 
2
 
3
-class BankPickerListController extends GetxController{
4
-  static BankPickerListController t=Get.find();
5
-  final bankPickerList=Rx<List>([]);
6
-}
3
+class BankPickerListController extends GetxController {
4
+  static BankPickerListController t = Get.find();
5
+  final bankPickerList = Rx<List>([]);
6
+}

+ 1
- 1
lib/models/entities/BankCard.dart View File

1
 class BankCardModel {
1
 class BankCardModel {
2
   String? cardId;
2
   String? cardId;
3
-  String cardNo='';
3
+  String cardNo = '';
4
   String? createDate;
4
   String? createDate;
5
   String? owerName;
5
   String? owerName;
6
   String? ownerBank;
6
   String? ownerBank;

+ 8
- 8
lib/models/entities/Banner.dart View File

17
         status = json["status"],
17
         status = json["status"],
18
         createDat = json["createDat"];
18
         createDat = json["createDat"];
19
   Map<String, dynamic> toJson() => {
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
-  };
20
+        "bannerId": bannerId,
21
+        "title": title,
22
+        "thumb": thumb,
23
+        "position": position,
24
+        "sortNo": sortNo,
25
+        "status": status,
26
+        "createDat": createDat,
27
+      };
28
 }
28
 }

+ 9
- 10
lib/models/entities/ExtendContent.dart View File

1
-
2
 class ExtendContent {
1
 class ExtendContent {
3
   // 租户号
2
   // 租户号
4
   String? extId;
3
   String? extId;
33
         createDate = json["createDate"];
32
         createDate = json["createDate"];
34
 
33
 
35
   Map<String, dynamic> toJson() => {
34
   Map<String, dynamic> toJson() => {
36
-    'extId' : extId,
37
-    'targetType' : targetType,
38
-    'targetId' : targetId,
39
-    'contentType' : contentType,
40
-    'content' : content,
41
-    'sort' : sort,
42
-    'createDate' : createDate,
43
-  };
44
-}
35
+        'extId': extId,
36
+        'targetType': targetType,
37
+        'targetId': targetId,
38
+        'contentType': contentType,
39
+        'content': content,
40
+        'sort': sort,
41
+        'createDate': createDate,
42
+      };
43
+}

+ 21
- 22
lib/models/entities/Log.dart View File

11
 
11
 
12
   LogModel();
12
   LogModel();
13
 
13
 
14
-  LogModel.fromJson(Map<String, dynamic> json):
15
-  logId=json['logId'],
16
-  payId=json['payId'],
17
-  accountId=json['accountId'],
18
-  feeType=json['feeType'],
19
-  chargeType=json['chargeType'],
20
-  money=json['money'],
21
-  orderId=json['orderId'],
22
-  remarks=json['remarks'],
23
-  createDate=json['createDate'];
14
+  LogModel.fromJson(Map<String, dynamic> json)
15
+      : logId = json['logId'],
16
+        payId = json['payId'],
17
+        accountId = json['accountId'],
18
+        feeType = json['feeType'],
19
+        chargeType = json['chargeType'],
20
+        money = json['money'],
21
+        orderId = json['orderId'],
22
+        remarks = json['remarks'],
23
+        createDate = json['createDate'];
24
 
24
 
25
   Map<String, dynamic> toJson() => {
25
   Map<String, dynamic> toJson() => {
26
-    'logId':logId,
27
-    'payId':payId,
28
-    'accountId':accountId,
29
-    'feeType':feeType,
30
-    'chargeType':chargeType,
31
-    'money':money,
32
-    'orderId':orderId,
33
-    'remarks':remarks,
34
-    'createDate':createDate,
35
-  };
36
-
37
-}
26
+        'logId': logId,
27
+        'payId': payId,
28
+        'accountId': accountId,
29
+        'feeType': feeType,
30
+        'chargeType': chargeType,
31
+        'money': money,
32
+        'orderId': orderId,
33
+        'remarks': remarks,
34
+        'createDate': createDate,
35
+      };
36
+}

+ 1
- 2
lib/models/entities/PagedResult.dart View File

1
-
2
 class PagedResult {
1
 class PagedResult {
3
   num total;
2
   num total;
4
   num size;
3
   num size;
15
   });
14
   });
16
 
15
 
17
   PagedResult.fromJson(Map<String, dynamic> json)
16
   PagedResult.fromJson(Map<String, dynamic> json)
18
-    : total = json['total'],
17
+      : total = json['total'],
19
         size = json['size'],
18
         size = json['size'],
20
         pages = json['pages'],
19
         pages = json['pages'],
21
         current = json['current'],
20
         current = json['current'],

+ 0
- 2
lib/models/index.dart View File

1
-
2
 export 'app.dart';
1
 export 'app.dart';
3
 
2
 
4
 import 'package:get/get.dart';
3
 import 'package:get/get.dart';
14
     Get.put(BankPickerListController());
13
     Get.put(BankPickerListController());
15
   }
14
   }
16
 }
15
 }
17
-

+ 2
- 2
lib/pages/addBankCard/index.dart View File

24
   BankCardListController bankCardListStore = BankCardListController.t;
24
   BankCardListController bankCardListStore = BankCardListController.t;
25
   BankPickerListController bankPickerListStore = BankPickerListController.t;
25
   BankPickerListController bankPickerListStore = BankPickerListController.t;
26
   RegExp exp = RegExp(r'^1[3456789]\d{9}$');
26
   RegExp exp = RegExp(r'^1[3456789]\d{9}$');
27
-  FocusNode focusNode=FocusNode();
27
+  FocusNode focusNode = FocusNode();
28
 
28
 
29
   //表单校验
29
   //表单校验
30
   bool handleRule() {
30
   bool handleRule() {
89
         });
89
         });
90
         bankList(list);
90
         bankList(list);
91
       },
91
       },
92
-    ).catchError((error){
92
+    ).catchError((error) {
93
       Fluttertoast.showToast(msg: error.error['message']);
93
       Fluttertoast.showToast(msg: error.error['message']);
94
     });
94
     });
95
   }
95
   }

+ 2
- 2
lib/pages/bankList/index.dart View File

55
           }
55
           }
56
           bankCardListStore.bankCardList(list1);
56
           bankCardListStore.bankCardList(list1);
57
           EasyLoading.dismiss();
57
           EasyLoading.dismiss();
58
-        }).catchError((error){
58
+        }).catchError((error) {
59
           EasyLoading.dismiss();
59
           EasyLoading.dismiss();
60
           Fluttertoast.showToast(msg: error.error['message']);
60
           Fluttertoast.showToast(msg: error.error['message']);
61
         });
61
         });
62
-      }).catchError((error2){
62
+      }).catchError((error2) {
63
         EasyLoading.dismiss();
63
         EasyLoading.dismiss();
64
         Fluttertoast.showToast(msg: error2.error['message']);
64
         Fluttertoast.showToast(msg: error2.error['message']);
65
       });
65
       });

+ 1
- 1
lib/pages/bankList/widget/BankCard.dart View File

46
               Expanded(
46
               Expanded(
47
                 flex: 1,
47
                 flex: 1,
48
                 child: Text(
48
                 child: Text(
49
-                  item.ownerBank.toString()+'储蓄卡',
49
+                  item.ownerBank.toString() + '储蓄卡',
50
                   style: const TextStyle(
50
                   style: const TextStyle(
51
                     color: Colors.white,
51
                     color: Colors.white,
52
                   ),
52
                   ),

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

189
   Widget builder(BuildContext context) {
189
   Widget builder(BuildContext context) {
190
     return Container(
190
     return Container(
191
       decoration: const BoxDecoration(color: Colors.white),
191
       decoration: const BoxDecoration(color: Colors.white),
192
-      padding: EdgeInsets.only(top:15.w,left: 15.w,right: 15.w),
192
+      padding: EdgeInsets.only(top: 15.w, left: 15.w, right: 15.w),
193
       child: Column(
193
       child: Column(
194
         children: [
194
         children: [
195
           const headers(),
195
           const headers(),

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

27
         ),
27
         ),
28
         const Icon(Icons.arrow_drop_down),
28
         const Icon(Icons.arrow_drop_down),
29
         Expanded(
29
         Expanded(
30
-          flex: 1,
30
+            flex: 1,
31
             child: Container(
31
             child: Container(
32
               margin: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
32
               margin: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
33
               padding: EdgeInsets.symmetric(vertical: 0, horizontal: 15.w),
33
               padding: EdgeInsets.symmetric(vertical: 0, horizontal: 15.w),
58
                   ],
58
                   ],
59
                 ),
59
                 ),
60
               ),
60
               ),
61
-            ))
62
-        ,
61
+            )),
63
       ],
62
       ],
64
     );
63
     );
65
   }
64
   }

+ 3
- 2
lib/pages/machineryDetail/index.dart View File

23
     super.beforeShow();
23
     super.beforeShow();
24
     if (Get.arguments != null) {
24
     if (Get.arguments != null) {
25
       EasyLoading.show(status: '数据加载中...');
25
       EasyLoading.show(status: '数据加载中...');
26
-      getMachineryDetail(Get.arguments['id'],
27
-          {'attached': true, 'location': location}).then((res) {
26
+      getMachineryDetail(
27
+              Get.arguments['id'], {'attached': true, 'location': location})
28
+          .then((res) {
28
         machinery(Machinery.fromJson(res));
29
         machinery(Machinery.fromJson(res));
29
         EasyLoading.dismiss();
30
         EasyLoading.dismiss();
30
       }).catchError((error) {
31
       }).catchError((error) {

+ 1
- 2
lib/pages/machineryList/index.dart View File

48
         useState: (state) {
48
         useState: (state) {
49
           machineryList(GetList(state));
49
           machineryList(GetList(state));
50
         },
50
         },
51
-        builder: ({required BuildContext context,
52
-          required Function toggle}) {
51
+        builder: ({required BuildContext context, required Function toggle}) {
53
           Refresh = toggle;
52
           Refresh = toggle;
54
           return Obx(
53
           return Obx(
55
             () => Column(
54
             () => Column(

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

21
   final current = Rx<Machinery>(Machinery());
21
   final current = Rx<Machinery>(Machinery());
22
   final visible = Rx<bool>(true);
22
   final visible = Rx<bool>(true);
23
 
23
 
24
-
25
   dynamic locList = [
24
   dynamic locList = [
26
     '32.685927, 112.106514',
25
     '32.685927, 112.106514',
27
     '32.673406, 112.100406',
26
     '32.673406, 112.100406',

+ 2
- 0
lib/pages/main/index.dart View File

3
 import 'package:get/get.dart';
3
 import 'package:get/get.dart';
4
 import 'package:get_storage/get_storage.dart';
4
 import 'package:get_storage/get_storage.dart';
5
 import 'package:worker_client/models/app.dart';
5
 import 'package:worker_client/models/app.dart';
6
+import 'package:worker_client/widgets/Copyright.dart';
6
 import 'package:worker_client/widgets/GradientButton.dart';
7
 import 'package:worker_client/widgets/GradientButton.dart';
7
 import 'package:worker_client/widgets/MyCell/index.dart';
8
 import 'package:worker_client/widgets/MyCell/index.dart';
8
 import 'package:worker_client/widgets/layout/BasicPage.dart';
9
 import 'package:worker_client/widgets/layout/BasicPage.dart';
354
                             ),
355
                             ),
355
                           ),
356
                           ),
356
                         ),
357
                         ),
358
+                        Copyright()
357
                       ],
359
                       ],
358
                     ),
360
                     ),
359
                   ),
361
                   ),

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

1
-
2
 export 'pages.dart';
1
 export 'pages.dart';
3
 export 'middleWares.dart';
2
 export 'middleWares.dart';

+ 1
- 2
lib/routes/middleWares.dart View File

1
-
2
 import 'package:flutter/scheduler.dart';
1
 import 'package:flutter/scheduler.dart';
3
 import 'package:get/get.dart';
2
 import 'package:get/get.dart';
4
 import 'package:get_storage/get_storage.dart';
3
 import 'package:get_storage/get_storage.dart';
5
 
4
 
6
-void routingCallback (routing) {
5
+void routingCallback(routing) {
7
   // GetStorage box = GetStorage();
6
   // GetStorage box = GetStorage();
8
   // bool isLogin = box.hasData('token');
7
   // bool isLogin = box.hasData('token');
9
   // bool isSplashScreen = routing?.current == '/splash';
8
   // bool isSplashScreen = routing?.current == '/splash';

+ 8
- 9
lib/routes/pages.dart View File

2
 import 'package:get_storage/get_storage.dart';
2
 import 'package:get_storage/get_storage.dart';
3
 import 'package:worker_client/pages/index.dart';
3
 import 'package:worker_client/pages/index.dart';
4
 
4
 
5
-
6
-
7
-
8
-List<GetPage> pages=[
9
-  GetPage(name: '/', page: (){
10
-    GetStorage box=GetStorage();
11
-    return box.hasData('token')?Home():Login();
12
-  }),
5
+List<GetPage> pages = [
6
+  GetPage(
7
+      name: '/',
8
+      page: () {
9
+        GetStorage box = GetStorage();
10
+        return box.hasData('token') ? Home() : Login();
11
+      }),
13
   GetPage(name: '/order', page: () => Order()),
12
   GetPage(name: '/order', page: () => Order()),
14
   GetPage(name: '/login', page: () => const Login()),
13
   GetPage(name: '/login', page: () => const Login()),
15
   GetPage(name: '/home', page: () => Home()),
14
   GetPage(name: '/home', page: () => Home()),
27
   GetPage(name: '/aboutUs', page: () => AboutUs()),
26
   GetPage(name: '/aboutUs', page: () => AboutUs()),
28
   GetPage(name: '/agreement', page: () => Agreement()),
27
   GetPage(name: '/agreement', page: () => Agreement()),
29
   GetPage(name: '/feedback', page: () => Feedback()),
28
   GetPage(name: '/feedback', page: () => Feedback()),
30
-];
29
+];

+ 3
- 4
lib/services/banner.dart View File

9
  */
9
  */
10
 Future getBannerList(String position) async {
10
 Future getBannerList(String position) async {
11
   return request('/banner',
11
   return request('/banner',
12
-      options: Options(method: 'GET'), data: {'position': position})
12
+          options: Options(method: 'GET'), data: {'position': position})
13
       .catchError((error) => {
13
       .catchError((error) => {
14
-    Fluttertoast.showToast(msg: error.error.toString()),
15
-  });
14
+            Fluttertoast.showToast(msg: error.error.toString()),
15
+          });
16
 }
16
 }
17
-

+ 4
- 4
lib/services/feedback.dart View File

10
 
10
 
11
 Future feedback(String content) async {
11
 Future feedback(String content) async {
12
   return request('/feedback',
12
   return request('/feedback',
13
-      options: Options(method: 'POST'), data: {'content': content})
13
+          options: Options(method: 'POST'), data: {'content': content})
14
       .catchError((error) => {
14
       .catchError((error) => {
15
-    Fluttertoast.showToast(msg: error.error['message']),
16
-  });
17
-}
15
+            Fluttertoast.showToast(msg: error.error['message']),
16
+          });
17
+}

+ 3
- 2
lib/services/job.dart View File

29
  */
29
  */
30
 Future startJob(String id, params) async {
30
 Future startJob(String id, params) async {
31
   return request('/work-job/$id/pause',
31
   return request('/work-job/$id/pause',
32
-          options: Options(method: 'PUT'), queryParameters: params);
32
+      options: Options(method: 'PUT'), queryParameters: params);
33
 }
33
 }
34
+
34
 /// 开始作业
35
 /// 开始作业
35
 /// @param {*}
36
 /// @param {*}
36
 /// @returns
37
 /// @returns
37
 Future overJob(String id, data) async {
38
 Future overJob(String id, data) async {
38
   return request('/work-job/$id/stop',
39
   return request('/work-job/$id/stop',
39
       options: Options(method: 'PUT'), data: data);
40
       options: Options(method: 'PUT'), data: data);
40
-}
41
+}

+ 6
- 9
lib/services/order.dart View File

7
 /// @returns
7
 /// @returns
8
 Future getOrderList(params) async {
8
 Future getOrderList(params) async {
9
   return request('/order',
9
   return request('/order',
10
-      options: Options(method: 'GET'), queryParameters: params)
11
-      .catchError((error) => {
12
-    Fluttertoast.showToast(msg: error.error.toString()),
13
-    print(error)
14
-  });
10
+          options: Options(method: 'GET'), queryParameters: params)
11
+      .catchError((error) =>
12
+          {Fluttertoast.showToast(msg: error.error.toString()), print(error)});
15
 }
13
 }
16
 
14
 
17
 /// 订单详情
15
 /// 订单详情
18
 /// @param {*} data
16
 /// @param {*} data
19
 /// @returns
17
 /// @returns
20
 Future getOrderDetail(String id) async {
18
 Future getOrderDetail(String id) async {
21
-  return request('/order/$id',
22
-      options: Options(method: 'GET'))
19
+  return request('/order/$id', options: Options(method: 'GET'))
23
       .catchError((error) => {
20
       .catchError((error) => {
24
-    Fluttertoast.showToast(msg: error.error['message']),
25
-  });
21
+            Fluttertoast.showToast(msg: error.error['message']),
22
+          });
26
 }
23
 }

+ 4
- 6
lib/theme.dart View File

1
-
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
 
3
 
11
       elevation: 0,
10
       elevation: 0,
12
       toolbarHeight: 44.w,
11
       toolbarHeight: 44.w,
13
       titleTextStyle: TextStyle(
12
       titleTextStyle: TextStyle(
14
-        color: const Color(0xFF333333),
15
-        fontWeight: FontWeight.bold,
16
-        fontSize: 17.sp,
17
-        letterSpacing: 2
18
-      ),
13
+          color: const Color(0xFF333333),
14
+          fontWeight: FontWeight.bold,
15
+          fontSize: 17.sp,
16
+          letterSpacing: 2),
19
     ),
17
     ),
20
     backgroundColor: Colors.white,
18
     backgroundColor: Colors.white,
21
   );
19
   );

+ 0
- 2
lib/utils/Request.dart View File

4
 import 'package:get/get.dart';
4
 import 'package:get/get.dart';
5
 import 'package:get_storage/get_storage.dart';
5
 import 'package:get_storage/get_storage.dart';
6
 
6
 
7
-
8
 class Response {
7
 class Response {
9
   late int code;
8
   late int code;
10
   String? message;
9
   String? message;
38
 
37
 
39
   var dio = Dio(options);
38
   var dio = Dio(options);
40
   dio.interceptors.add(InterceptorsWrapper(onRequest: (options, handler) {
39
   dio.interceptors.add(InterceptorsWrapper(onRequest: (options, handler) {
41
-
42
     // Do something before request is sent
40
     // Do something before request is sent
43
     options.headers['Authorization'] = GetStorage().read("token");
41
     options.headers['Authorization'] = GetStorage().read("token");
44
     return handler.next(options); //continue
42
     return handler.next(options); //continue

+ 2
- 3
lib/utils/amap/const_config.dart View File

7
   ///注意:使用[AMapWidget]的`apiKey`属性设置的key的优先级高于通过Native配置key的优先级,
7
   ///注意:使用[AMapWidget]的`apiKey`属性设置的key的优先级高于通过Native配置key的优先级,
8
   ///使用[AMapWidget]的`apiKey`属性配置后Native配置的key将失效,请根据实际情况选择使用
8
   ///使用[AMapWidget]的`apiKey`属性配置后Native配置的key将失效,请根据实际情况选择使用
9
   static const AMapApiKey amapApiKeys = AMapApiKey(
9
   static const AMapApiKey amapApiKeys = AMapApiKey(
10
-      androidKey: 'b481b4187e24e625fa0056fd0530e663',
11
-      iosKey: '您申请的iOS平台的key');
10
+      androidKey: 'b481b4187e24e625fa0056fd0530e663', iosKey: '您申请的iOS平台的key');
12
 
11
 
13
   ///高德隐私合规声明,这里只是示例,实际使用中请按照实际参数设置[AMapPrivacyStatement]的'hasContains''hasShow''hasAgree'这三个参数
12
   ///高德隐私合规声明,这里只是示例,实际使用中请按照实际参数设置[AMapPrivacyStatement]的'hasContains''hasShow''hasAgree'这三个参数
14
   ///
13
   ///
18
   ///
17
   ///
19
   /// 高德SDK合规使用方案请参考:https://lbs.amap.com/news/sdkhgsy
18
   /// 高德SDK合规使用方案请参考:https://lbs.amap.com/news/sdkhgsy
20
   static const AMapPrivacyStatement amapPrivacyStatement =
19
   static const AMapPrivacyStatement amapPrivacyStatement =
21
-  AMapPrivacyStatement(hasContains: true, hasShow: true, hasAgree: true);
20
+      AMapPrivacyStatement(hasContains: true, hasShow: true, hasAgree: true);
22
 }
21
 }

+ 4
- 4
lib/utils/location.dart View File

6
 
6
 
7
 import 'amap/const_config.dart';
7
 import 'amap/const_config.dart';
8
 
8
 
9
-typedef AMAPListener = void Function (Map<String, Object>);
9
+typedef AMAPListener = void Function(Map<String, Object>);
10
 
10
 
11
 void showPrivacy() {
11
 void showPrivacy() {
12
   /// 设置是否已经包含高德隐私政策并弹窗展示显示用户查看,如果未包含或者没有弹窗展示,高德定位SDK将不会工作
12
   /// 设置是否已经包含高德隐私政策并弹窗展示显示用户查看,如果未包含或者没有弹窗展示,高德定位SDK将不会工作
44
 }
44
 }
45
 
45
 
46
 Future requireLocation(AMAPListener listener) async {
46
 Future requireLocation(AMAPListener listener) async {
47
-  AMapFlutterLocation.setApiKey(ConstConfig.amapApiKeys.androidKey!, ConstConfig.amapApiKeys.iosKey!);
47
+  AMapFlutterLocation.setApiKey(
48
+      ConstConfig.amapApiKeys.androidKey!, ConstConfig.amapApiKeys.iosKey!);
48
   showPrivacy();
49
   showPrivacy();
49
   await _requirePermission();
50
   await _requirePermission();
50
   final AMapFlutterLocation location = AMapFlutterLocation();
51
   final AMapFlutterLocation location = AMapFlutterLocation();
100
   return locationOption;
101
   return locationOption;
101
 }
102
 }
102
 
103
 
103
-
104
 // import 'dart:io';
104
 // import 'dart:io';
105
 //
105
 //
106
 // import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'
106
 // import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'
131
 //   }
131
 //   }
132
 //
132
 //
133
 //   return location;
133
 //   return location;
134
-// }
134
+// }

+ 2
- 3
lib/utils/timer.dart View File

1
-
2
 import 'dart:async';
1
 import 'dart:async';
3
 
2
 
4
-Timer setInterval(void Function (Timer) f, int milliseconds) {
3
+Timer setInterval(void Function(Timer) f, int milliseconds) {
5
   var duration = Duration(milliseconds: milliseconds);
4
   var duration = Duration(milliseconds: milliseconds);
6
   return Timer.periodic(duration, f);
5
   return Timer.periodic(duration, f);
7
 }
6
 }
8
 
7
 
9
-Timer setTimeout(void Function () f, int milliseconds) {
8
+Timer setTimeout(void Function() f, int milliseconds) {
10
   var duration = Duration(milliseconds: milliseconds);
9
   var duration = Duration(milliseconds: milliseconds);
11
   return Timer(duration, f);
10
   return Timer(duration, f);
12
 }
11
 }

+ 20
- 22
lib/widgets/Cell.dart View File

1
-
2
 import 'package:flutter/cupertino.dart';
1
 import 'package:flutter/cupertino.dart';
3
 import 'package:flutter/widgets.dart';
2
 import 'package:flutter/widgets.dart';
4
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3
 import 'package:flutter_screenutil/flutter_screenutil.dart';
5
 
4
 
6
 class Cell extends StatelessWidget {
5
 class Cell extends StatelessWidget {
7
-  const Cell ({
6
+  const Cell({
8
     Key? key,
7
     Key? key,
9
     this.header,
8
     this.header,
10
     required this.child,
9
     required this.child,
19
 
18
 
20
   @override
19
   @override
21
   Widget build(BuildContext context) {
20
   Widget build(BuildContext context) {
22
-
23
     return Container(
21
     return Container(
24
       margin: margin,
22
       margin: margin,
25
       padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 0.0),
23
       padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 0.0),
26
       decoration: const BoxDecoration(
24
       decoration: const BoxDecoration(
27
-        border: Border(
28
-          bottom: BorderSide(width: 1.0, color: Color(0x1F000000)),
29
-        )
30
-      ),
25
+          border: Border(
26
+        bottom: BorderSide(width: 1.0, color: Color(0x1F000000)),
27
+      )),
31
       child: Row(
28
       child: Row(
32
         children: [
29
         children: [
33
-          if (null != header) SizedBox(
34
-            width: 53.w,
35
-            child: Container(
36
-              decoration: const BoxDecoration(
37
-                border: Border(
38
-                  right: BorderSide(width: 1, color: Color(0xFF333333))
39
-                )
30
+          if (null != header)
31
+            SizedBox(
32
+              width: 53.w,
33
+              child: Container(
34
+                decoration: const BoxDecoration(
35
+                    border: Border(
36
+                        right: BorderSide(width: 1, color: Color(0xFF333333)))),
37
+                child: header,
40
               ),
38
               ),
41
-              child: header,
42
             ),
39
             ),
40
+          Expanded(
41
+            child: child,
43
           ),
42
           ),
44
-          Expanded(child: child,),
45
-          if (null != footer) ConstrainedBox (
46
-            constraints: const BoxConstraints(),
47
-            child: footer,
48
-          )
43
+          if (null != footer)
44
+            ConstrainedBox(
45
+              constraints: const BoxConstraints(),
46
+              child: footer,
47
+            )
49
         ],
48
         ],
50
       ),
49
       ),
51
     );
50
     );
52
   }
51
   }
53
-  
54
-}
52
+}

+ 18
- 0
lib/widgets/Copyright.dart View File

1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+class Copyright extends StatelessWidget {
5
+  @override
6
+  Widget build(BuildContext context) {
7
+    return Container(
8
+      margin: const EdgeInsets.fromLTRB(0, 5, 0, 15),
9
+      child: Text(
10
+        '南京市云致科技服务有限公司 提供技术支持',
11
+        style: TextStyle(
12
+          fontSize: 15.sp,
13
+          color: const Color(0xff999999),
14
+        ),
15
+      ),
16
+    );
17
+  }
18
+}

+ 7
- 4
lib/widgets/GradientButton.dart View File

1
-
2
-
3
 import 'package:flutter/material.dart';
1
 import 'package:flutter/material.dart';
4
 
2
 
5
 class GradientButton extends StatelessWidget {
3
 class GradientButton extends StatelessWidget {
46
 
44
 
47
     return DecoratedBox(
45
     return DecoratedBox(
48
       decoration: BoxDecoration(
46
       decoration: BoxDecoration(
49
-        gradient: disabled ? null : LinearGradient(begin: linearStart??Alignment.topCenter, end: linearEnd??Alignment.bottomCenter, colors: _colors),
47
+        gradient: disabled
48
+            ? null
49
+            : LinearGradient(
50
+                begin: linearStart ?? Alignment.topCenter,
51
+                end: linearEnd ?? Alignment.bottomCenter,
52
+                colors: _colors),
50
         color: disabled ? disabledColor ?? theme.disabledColor : null,
53
         color: disabled ? disabledColor ?? theme.disabledColor : null,
51
         borderRadius: radius,
54
         borderRadius: radius,
52
       ),
55
       ),
84
       ),
87
       ),
85
     );
88
     );
86
   }
89
   }
87
-}
90
+}

+ 5
- 5
lib/widgets/Modal.dart View File

38
 /// 打开一个 dialog
38
 /// 打开一个 dialog
39
 void showDialog(
39
 void showDialog(
40
     {required String title,
40
     {required String title,
41
-      lazy = false,
41
+    lazy = false,
42
     String? message,
42
     String? message,
43
     Widget? content,
43
     Widget? content,
44
     ModalFunc? onConfirm,
44
     ModalFunc? onConfirm,
48
     title: title,
48
     title: title,
49
     message: message,
49
     message: message,
50
     content: content,
50
     content: content,
51
-    onConfirm: () => _handleFunc(onConfirm,lazy),
52
-    onCancel: () => _handleFunc(onCancel,lazy),
51
+    onConfirm: () => _handleFunc(onConfirm, lazy),
52
+    onCancel: () => _handleFunc(onCancel, lazy),
53
   ));
53
   ));
54
 }
54
 }
55
 
55
 
56
 /// 打开一个 alert
56
 /// 打开一个 alert
57
 void showAlert(
57
 void showAlert(
58
     {required String title,
58
     {required String title,
59
-      bool lazy = false,
59
+    bool lazy = false,
60
     String? message,
60
     String? message,
61
     Widget? content,
61
     Widget? content,
62
     ModalFunc? onConfirm}) {
62
     ModalFunc? onConfirm}) {
65
     title: title,
65
     title: title,
66
     message: message,
66
     message: message,
67
     content: content,
67
     content: content,
68
-    onConfirm: () => _handleFunc(onConfirm,lazy),
68
+    onConfirm: () => _handleFunc(onConfirm, lazy),
69
   ));
69
   ));
70
 }
70
 }
71
 
71
 

+ 7
- 3
lib/widgets/MoneyCard/index.dart View File

5
   final bool type;
5
   final bool type;
6
   final double amounts;
6
   final double amounts;
7
   final GestureTapCallback goWithDrawal;
7
   final GestureTapCallback goWithDrawal;
8
-  const MoneyCard({Key? key, this.type = false, required this.amounts, required this.goWithDrawal}) : super(key: key);
8
+  const MoneyCard(
9
+      {Key? key,
10
+      this.type = false,
11
+      required this.amounts,
12
+      required this.goWithDrawal})
13
+      : super(key: key);
9
 
14
 
10
   @override
15
   @override
11
   State<MoneyCard> createState() => _MoneyCardState();
16
   State<MoneyCard> createState() => _MoneyCardState();
12
 }
17
 }
13
 
18
 
14
 class _MoneyCardState extends State<MoneyCard> {
19
 class _MoneyCardState extends State<MoneyCard> {
15
-
16
   @override
20
   @override
17
   Widget build(BuildContext context) {
21
   Widget build(BuildContext context) {
18
     return Container(
22
     return Container(
49
             ),
53
             ),
50
           ),
54
           ),
51
           Opacity(
55
           Opacity(
52
-            opacity: !widget.type?1:0,
56
+            opacity: !widget.type ? 1 : 0,
53
             child: GestureDetector(
57
             child: GestureDetector(
54
               onTap: widget.goWithDrawal,
58
               onTap: widget.goWithDrawal,
55
               child: Container(
59
               child: Container(

+ 1
- 1
lib/widgets/MyButton/entities/Gradient.dart View File

4
   final Color beginColor;
4
   final Color beginColor;
5
   final Color endColor;
5
   final Color endColor;
6
   GradientModel(this.beginColor, this.endColor);
6
   GradientModel(this.beginColor, this.endColor);
7
-}
7
+}

+ 6
- 8
lib/widgets/MyButton/index.dart View File

19
       required this.text,
19
       required this.text,
20
       required this.type,
20
       required this.type,
21
       required this.disable,
21
       required this.disable,
22
-      required this.onClick, this.pwith})
22
+      required this.onClick,
23
+      this.pwith})
23
       : super(key: key);
24
       : super(key: key);
24
 
25
 
25
-  List<GradientModel> Glist=[
26
+  List<GradientModel> Glist = [
26
     GradientModel(Color(0xFFA0E067), Color(0xFF00AE39)),
27
     GradientModel(Color(0xFFA0E067), Color(0xFF00AE39)),
27
     GradientModel(Color(0xFFFFAB8C), Color(0xFFFF703B)),
28
     GradientModel(Color(0xFFFFAB8C), Color(0xFFFF703B)),
28
   ];
29
   ];
30
   Widget build(BuildContext context) {
31
   Widget build(BuildContext context) {
31
     return Container(
32
     return Container(
32
       margin: EdgeInsets.fromLTRB(0, 12.5.h, 0, 9.h),
33
       margin: EdgeInsets.fromLTRB(0, 12.5.h, 0, 9.h),
33
-      width: 315.w+(pwith??0),
34
+      width: 315.w + (pwith ?? 0),
34
       height: 49.h,
35
       height: 49.h,
35
       child: GradientButton(
36
       child: GradientButton(
36
-          colors: [Glist[type].beginColor,Glist[type].endColor],
37
+          colors: [Glist[type].beginColor, Glist[type].endColor],
37
           borderRadius: BorderRadius.all(Radius.circular(24.5.w)),
38
           borderRadius: BorderRadius.all(Radius.circular(24.5.w)),
38
           onPressed: disable ? null : onClick,
39
           onPressed: disable ? null : onClick,
39
           child: Text(
40
           child: Text(
40
             text,
41
             text,
41
             style: TextStyle(
42
             style: TextStyle(
42
-              fontSize: 17.sp,
43
-              fontWeight: FontWeight.bold,
44
-              letterSpacing: 2
45
-            ),
43
+                fontSize: 17.sp, fontWeight: FontWeight.bold, letterSpacing: 2),
46
           )),
44
           )),
47
     );
45
     );
48
   }
46
   }

+ 2
- 2
lib/widgets/MyCard/entities/ItemColor.dart View File

1
 import 'dart:ui';
1
 import 'dart:ui';
2
 
2
 
3
-class ItemColor{
3
+class ItemColor {
4
   final Color borderColor;
4
   final Color borderColor;
5
   final Color leftColor;
5
   final Color leftColor;
6
   final Color rightColor;
6
   final Color rightColor;
7
   ItemColor(this.borderColor, this.leftColor, this.rightColor);
7
   ItemColor(this.borderColor, this.leftColor, this.rightColor);
8
-}
8
+}

+ 9
- 5
lib/widgets/MyCard/index.dart View File

46
       ),
46
       ),
47
       child: Stack(
47
       child: Stack(
48
         children: [
48
         children: [
49
-          Jianbian(status: job?item.status:item.workStatus),
49
+          Jianbian(status: job ? item.status : item.workStatus),
50
           Container(
50
           Container(
51
             padding: EdgeInsets.all(20.w),
51
             padding: EdgeInsets.all(20.w),
52
             child: Column(
52
             child: Column(
146
                 Visibility(
146
                 Visibility(
147
                     child: CardCell(
147
                     child: CardCell(
148
                         lable: '作业时间',
148
                         lable: '作业时间',
149
-                        content:  item is Job ? item.startDate.toString() : '' +
150
-                            (item is Job ? (item?.endDate != null
151
-                            ? '\n' + item.endDate.toString()
152
-                            : '') : ''),
149
+                        content: item is Job
150
+                            ? item.startDate.toString()
151
+                            : '' +
152
+                                (item is Job
153
+                                    ? (item?.endDate != null
154
+                                        ? '\n' + item.endDate.toString()
155
+                                        : '')
156
+                                    : ''),
153
                         size: 2),
157
                         size: 2),
154
                     visible: job),
158
                     visible: job),
155
                 CardCell(
159
                 CardCell(

+ 6
- 7
lib/widgets/MyCard/widgets/CardCell.dart View File

8
 
8
 
9
   const CardCell(
9
   const CardCell(
10
       {Key? key,
10
       {Key? key,
11
-        required this.lable,
12
-        required this.content,
13
-        required this.size})
11
+      required this.lable,
12
+      required this.content,
13
+      required this.size})
14
       : super(key: key);
14
       : super(key: key);
15
 
15
 
16
   @override
16
   @override
31
             ),
31
             ),
32
           ),
32
           ),
33
           Text(
33
           Text(
34
-            lable==''?'    ':':',
34
+            lable == '' ? '    ' : ':',
35
             style: TextStyle(
35
             style: TextStyle(
36
               fontSize: 17.sp,
36
               fontSize: 17.sp,
37
               color: const Color(0xFF606060),
37
               color: const Color(0xFF606060),
47
                   fontSize: 17.sp,
47
                   fontSize: 17.sp,
48
                   color: Color(0xFF101010),
48
                   color: Color(0xFF101010),
49
                   fontWeight: FontWeight.bold,
49
                   fontWeight: FontWeight.bold,
50
-                  height: 1.5
51
-              ),
50
+                  height: 1.5),
52
             ),
51
             ),
53
           ),
52
           ),
54
         ],
53
         ],
55
       ),
54
       ),
56
     );
55
     );
57
   }
56
   }
58
-}
57
+}

+ 1
- 3
lib/widgets/MyCell/index.dart View File

21
       child: Container(
21
       child: Container(
22
         margin: EdgeInsets.fromLTRB(0, 0, 0, 1.h),
22
         margin: EdgeInsets.fromLTRB(0, 0, 0, 1.h),
23
         padding: EdgeInsets.symmetric(horizontal: 17.5.w, vertical: 19.h),
23
         padding: EdgeInsets.symmetric(horizontal: 17.5.w, vertical: 19.h),
24
-        decoration: BoxDecoration(
25
-            color: Colors.white,
26
-            boxShadow: [
24
+        decoration: BoxDecoration(color: Colors.white, boxShadow: [
27
           BoxShadow(
25
           BoxShadow(
28
               color: const Color(0x1f000000),
26
               color: const Color(0x1f000000),
29
               offset: Offset(0, 1.w),
27
               offset: Offset(0, 1.w),

+ 14
- 19
lib/widgets/MyDialog.dart View File

36
 }
36
 }
37
 
37
 
38
 /// 打开一个 dialog
38
 /// 打开一个 dialog
39
-void showDialog(
40
-    {String? title,
41
-      lazy = false,
42
-    String? message,
43
-    Widget? content,
44
-    ModalFunc? onConfirm,
45
-    }) {
39
+void showDialog({
40
+  String? title,
41
+  lazy = false,
42
+  String? message,
43
+  Widget? content,
44
+  ModalFunc? onConfirm,
45
+}) {
46
   Get.dialog(Modal(
46
   Get.dialog(Modal(
47
     type: 'dialog',
47
     type: 'dialog',
48
     title: title,
48
     title: title,
49
     message: message,
49
     message: message,
50
     content: content,
50
     content: content,
51
-    onConfirm: () => _handleFunc(onConfirm,lazy),
51
+    onConfirm: () => _handleFunc(onConfirm, lazy),
52
   ));
52
   ));
53
 }
53
 }
54
 
54
 
55
 /// 打开一个 alert
55
 /// 打开一个 alert
56
 void showAlert(
56
 void showAlert(
57
     {required String title,
57
     {required String title,
58
-      lazy = false,
58
+    lazy = false,
59
     String? message,
59
     String? message,
60
     Widget? content,
60
     Widget? content,
61
     ModalFunc? onConfirm,
61
     ModalFunc? onConfirm,
62
-      ModalFunc? onCancel
63
-    }) {
62
+    ModalFunc? onCancel}) {
64
   Get.dialog(Modal(
63
   Get.dialog(Modal(
65
     type: 'alert',
64
     type: 'alert',
66
     title: title,
65
     title: title,
67
     message: message,
66
     message: message,
68
     content: content,
67
     content: content,
69
-    onConfirm: () => _handleFunc(onConfirm,lazy),
70
-    onCancel: () => _handleFunc(onCancel,lazy),
68
+    onConfirm: () => _handleFunc(onConfirm, lazy),
69
+    onCancel: () => _handleFunc(onCancel, lazy),
71
   ));
70
   ));
72
 }
71
 }
73
 
72
 
139
     return ElevatedButton(
138
     return ElevatedButton(
140
       child: Text("取消",
139
       child: Text("取消",
141
           style: TextStyle(
140
           style: TextStyle(
142
-              color: _primaryColor, fontSize: 17.sp,letterSpacing: 2)),
141
+              color: _primaryColor, fontSize: 17.sp, letterSpacing: 2)),
143
       style: ElevatedButton.styleFrom(
142
       style: ElevatedButton.styleFrom(
144
         primary: Colors.white,
143
         primary: Colors.white,
145
         elevation: 0,
144
         elevation: 0,
164
           SizedBox(height: 16.w),
163
           SizedBox(height: 16.w),
165
           Row(
164
           Row(
166
             mainAxisAlignment: MainAxisAlignment.center,
165
             mainAxisAlignment: MainAxisAlignment.center,
167
-            children: [
168
-              _confirmBtn(),
169
-              hSpacer,
170
-              _cancelBtn()
171
-            ],
166
+            children: [_confirmBtn(), hSpacer, _cancelBtn()],
172
           )
167
           )
173
         ]);
168
         ]);
174
   }
169
   }

+ 2
- 3
lib/widgets/MyTitle/index.dart View File

1
-
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
 
3
 
5
-class MyTitle extends StatelessWidget{
4
+class MyTitle extends StatelessWidget {
6
   final String title;
5
   final String title;
7
 
6
 
8
   const MyTitle({Key? key, required this.title}) : super(key: key);
7
   const MyTitle({Key? key, required this.title}) : super(key: key);
29
       ),
28
       ),
30
     );
29
     );
31
   }
30
   }
32
-}
31
+}

+ 2
- 5
lib/widgets/NullCard.dart View File

21
           ),
21
           ),
22
           Text(
22
           Text(
23
             text,
23
             text,
24
-            style: TextStyle(
25
-                fontSize: 17.sp, color: Color(0xFFb4b4b4)),
24
+            style: TextStyle(fontSize: 17.sp, color: Color(0xFFb4b4b4)),
26
           )
25
           )
27
         ],
26
         ],
28
       ),
27
       ),
29
     );
28
     );
30
   }
29
   }
31
-
32
-
33
-}
30
+}

+ 6
- 8
lib/widgets/layout/BasicPage.dart View File

1
-
2
 import '/widgets/layout/bottomBar/BottomBar.dart';
1
 import '/widgets/layout/bottomBar/BottomBar.dart';
3
 import 'package:flutter/material.dart';
2
 import 'package:flutter/material.dart';
4
 import 'package:get/get.dart';
3
 import 'package:get/get.dart';
6
 import 'barList.dart';
5
 import 'barList.dart';
7
 
6
 
8
 abstract class BasicPage extends StatefulWidget {
7
 abstract class BasicPage extends StatefulWidget {
9
-
10
   // 导航标题
8
   // 导航标题
11
   // 用法 naviTitle = xxxx
9
   // 用法 naviTitle = xxxx
12
   final _title = Rx<String>("");
10
   final _title = Rx<String>("");
24
   bool? isPop;
22
   bool? isPop;
25
 
23
 
26
   //
24
   //
27
-  BasicPage({Key? key, this.canScroll = true,this.isPop, this.tabIndex }) : super(key: key);
25
+  BasicPage({Key? key, this.canScroll = true, this.isPop, this.tabIndex})
26
+      : super(key: key);
28
 
27
 
29
   @protected
28
   @protected
30
   Widget builder(BuildContext context);
29
   Widget builder(BuildContext context);
62
 }
61
 }
63
 
62
 
64
 class _BasicPageState extends State<BasicPage> {
63
 class _BasicPageState extends State<BasicPage> {
65
-
66
   @override
64
   @override
67
   void initState() {
65
   void initState() {
68
     super.initState();
66
     super.initState();
103
 
101
 
104
   @override
102
   @override
105
   Widget build(BuildContext context) {
103
   Widget build(BuildContext context) {
106
-
107
     return Scaffold(
104
     return Scaffold(
108
-      resizeToAvoidBottomInset: widget.isPop==null? false:true,
105
+      resizeToAvoidBottomInset: widget.isPop == null ? false : true,
109
       appBar: _getAppBar(),
106
       appBar: _getAppBar(),
110
       body: SafeArea(
107
       body: SafeArea(
111
         child: widget.builder(context),
108
         child: widget.builder(context),
112
       ),
109
       ),
113
-      bottomNavigationBar: widget.tabIndex == null ? null : BottomBar(list: BarList, current: widget.tabIndex!),
110
+      bottomNavigationBar: widget.tabIndex == null
111
+          ? null
112
+          : BottomBar(list: BarList, current: widget.tabIndex!),
114
     );
113
     );
115
   }
114
   }
116
 }
115
 }
117
-

+ 24
- 6
lib/widgets/layout/barList.dart View File

7
   BarItem(
7
   BarItem(
8
     label: '首页',
8
     label: '首页',
9
     page: '/',
9
     page: '/',
10
-    normal: Item (color: const Color(0xFF323232), fontSize: 15.sp, image: 'images/index/index.png'),
11
-    selected: Item (color: const Color(0xFF06B03B), fontSize: 15.sp, image: 'images/index/indexActive.png'),
10
+    normal: Item(
11
+        color: const Color(0xFF323232),
12
+        fontSize: 15.sp,
13
+        image: 'images/index/index.png'),
14
+    selected: Item(
15
+        color: const Color(0xFF06B03B),
16
+        fontSize: 15.sp,
17
+        image: 'images/index/indexActive.png'),
12
   ),
18
   ),
13
   BarItem(
19
   BarItem(
14
     label: '订单列表',
20
     label: '订单列表',
15
     page: '/order',
21
     page: '/order',
16
-    normal: Item (color: const Color(0xFF323232), fontSize: 15.sp, image: 'images/index/job.png'),
17
-    selected: Item (color: const Color(0xFF06B03B), fontSize: 15.sp, image: 'images/index/jobActive.png'),
22
+    normal: Item(
23
+        color: const Color(0xFF323232),
24
+        fontSize: 15.sp,
25
+        image: 'images/index/job.png'),
26
+    selected: Item(
27
+        color: const Color(0xFF06B03B),
28
+        fontSize: 15.sp,
29
+        image: 'images/index/jobActive.png'),
18
   ),
30
   ),
19
   BarItem(
31
   BarItem(
20
     label: '个人中心',
32
     label: '个人中心',
21
     page: '/main',
33
     page: '/main',
22
-    normal: Item (color: const Color(0xFF323232), fontSize: 15.sp, image: 'images/index/user.png'),
23
-    selected: Item (color: const Color(0xFF06B03B), fontSize: 15.sp, image: 'images/index/userActive.png'),
34
+    normal: Item(
35
+        color: const Color(0xFF323232),
36
+        fontSize: 15.sp,
37
+        image: 'images/index/user.png'),
38
+    selected: Item(
39
+        color: const Color(0xFF06B03B),
40
+        fontSize: 15.sp,
41
+        image: 'images/index/userActive.png'),
24
   ),
42
   ),
25
 ];
43
 ];

+ 8
- 9
lib/widgets/layout/bottomBar/BottomBar.dart View File

1
-
2
 import 'package:flutter/widgets.dart';
1
 import 'package:flutter/widgets.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 'item.dart';
4
 import 'item.dart';
6
 
5
 
7
 class BottomBarItem extends StatelessWidget {
6
 class BottomBarItem extends StatelessWidget {
8
-
9
   final bool selected;
7
   final bool selected;
10
   final BarItem data;
8
   final BarItem data;
11
 
9
 
12
-  BottomBarItem({Key? key, required this.selected, required this.data }) : super(key: key);
10
+  BottomBarItem({Key? key, required this.selected, required this.data})
11
+      : super(key: key);
13
 
12
 
14
   @override
13
   @override
15
   Widget build(BuildContext context) {
14
   Widget build(BuildContext context) {
17
     final color = selected ? data.selected.color : data.normal.color;
16
     final color = selected ? data.selected.color : data.normal.color;
18
     final fontSize = selected ? data.selected.fontSize : data.normal.fontSize;
17
     final fontSize = selected ? data.selected.fontSize : data.normal.fontSize;
19
 
18
 
20
-    final textStyle = TextStyle(color: color, fontSize: fontSize, fontWeight: FontWeight.bold);
19
+    final textStyle = TextStyle(
20
+        color: color, fontSize: fontSize, fontWeight: FontWeight.bold);
21
 
21
 
22
     return GestureDetector(
22
     return GestureDetector(
23
       onTap: () {
23
       onTap: () {
44
 }
44
 }
45
 
45
 
46
 class BottomBar extends StatelessWidget {
46
 class BottomBar extends StatelessWidget {
47
-
48
   final int current;
47
   final int current;
49
   List<BarItem> list;
48
   List<BarItem> list;
50
 
49
 
51
-  BottomBar({ Key? key , required this.list, required this.current }) : super(key: key);
50
+  BottomBar({Key? key, required this.list, required this.current})
51
+      : super(key: key);
52
 
52
 
53
   @override
53
   @override
54
   Widget build(BuildContext context) {
54
   Widget build(BuildContext context) {
73
               int index = list.indexOf(item);
73
               int index = list.indexOf(item);
74
 
74
 
75
               return Expanded(
75
               return Expanded(
76
-                  flex: 1,
77
-                  child: BottomBarItem(data: item, selected: current == index ),
76
+                flex: 1,
77
+                child: BottomBarItem(data: item, selected: current == index),
78
               );
78
               );
79
             })
79
             })
80
           ],
80
           ],
82
       ),
82
       ),
83
     );
83
     );
84
   }
84
   }
85
-
86
 }
85
 }

+ 6
- 3
lib/widgets/layout/bottomBar/item.dart View File

1
-
2
 import 'dart:ui';
1
 import 'dart:ui';
3
 
2
 
4
 class Item {
3
 class Item {
6
   Color color;
5
   Color color;
7
   String image;
6
   String image;
8
 
7
 
9
-  Item({ required this.fontSize, required this.color, required this.image });
8
+  Item({required this.fontSize, required this.color, required this.image});
10
 }
9
 }
11
 
10
 
12
 class BarItem {
11
 class BarItem {
15
   Item normal;
14
   Item normal;
16
   Item selected;
15
   Item selected;
17
 
16
 
18
-  BarItem ({ required this.label, required this.page, required this.normal, required this.selected });
17
+  BarItem(
18
+      {required this.label,
19
+      required this.page,
20
+      required this.normal,
21
+      required this.selected});
19
 }
22
 }