diff --git a/lib/tools/aku_map.dart b/lib/tools/aku_map.dart index 9f685cd..a7e94b6 100644 --- a/lib/tools/aku_map.dart +++ b/lib/tools/aku_map.dart @@ -63,17 +63,35 @@ class AkuMap { static Map fixAreaType = {1: '公区维修', 2: '家庭维修'}; ///报事报修处理进程-操作类型 - static Map operationType = { - 1: '提交报修', - 2: '派单', - 3: '开始处理', - 4: '处理完成', - 5: '确认', - 6: '回访', - 7: '回退', - 8: '作废', - 9: '取消' - }; + static String operationType(int operationType) { + switch (operationType) { + case 1: + return '提交保修'; + case 2: + return '派单'; + case 3: + return '开始处理'; + case 4: + return '处理完成'; + case 5: + return '确认'; + case 6: + return '回访'; + case 7: + return '回退'; + case 8: + return '作废'; + case 9: + return '取消'; + break; + case 10: + return '改派'; + case 11: + return '延时'; + default: + return ''; + } + } static Map dispatchType = {1: '无偿服务', 2: '有偿服务'}; } diff --git a/lib/ui/home/business/business_view.dart b/lib/ui/home/business/business_view.dart index f2c7dba..7fe71be 100644 --- a/lib/ui/home/business/business_view.dart +++ b/lib/ui/home/business/business_view.dart @@ -47,7 +47,8 @@ class _BussinessViewState extends State controller: _refreshController, header: MaterialHeader(), onRefresh: () async { - var dataList = await BussinessFunc.getBussinessModelList(widget.backlogStatus); + var dataList = + await BussinessFunc.getBussinessModelList(widget.backlogStatus); _modelList = dataList.map((e) => ToDoModel.fromJson(e)).toList(); setState(() {}); }, @@ -58,10 +59,18 @@ class _BussinessViewState extends State children: [ ..._modelList.map((e) { if (e.dynamicModel.runtimeType == BussinessAndFixModel) { - return BusinessFixCard(model: e.dynamicModel); + return BusinessFixCard( + model: e.dynamicModel, + callRefresh: () { + _refreshController.callRefresh(); + }, + ); } else if (e.dynamicModel.runtimeType == ToDoOutDoorModel) { return ToDoOutDoorCard( model: e.dynamicModel, + callRefresh: () { + _refreshController.callRefresh(); + }, ); } }).toList() @@ -74,8 +83,6 @@ class _BussinessViewState extends State return SizedBox(); } - - @override bool get wantKeepAlive => true; } diff --git a/lib/ui/home/business/todo_outdoor_card.dart b/lib/ui/home/business/todo_outdoor_card.dart index 2545981..3ac84b0 100644 --- a/lib/ui/home/business/todo_outdoor_card.dart +++ b/lib/ui/home/business/todo_outdoor_card.dart @@ -8,8 +8,9 @@ import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; class ToDoOutDoorCard extends StatefulWidget { - final ToDoOutDoorModel model; - ToDoOutDoorCard({Key key, this.model}) : super(key: key); + final ToDoOutDoorModel model; + final VoidCallback callRefresh; + ToDoOutDoorCard({Key key, this.model, this.callRefresh}) : super(key: key); @override _ToDoOutDoorCardState createState() => _ToDoOutDoorCardState(); @@ -191,8 +192,11 @@ class _ToDoOutDoorCardState extends State { height: 112.w, alignment: Alignment.centerRight, child: AkuButton( - onPressed: () { - Get.to(ItemsOutdoorDetailsPage(id: widget.model.id)); + onPressed: () async { + await Get.to(ItemsOutdoorDetailsPage(id: widget.model.id)); + if (widget.callRefresh != null) { + widget.callRefresh(); + } }, child: Container( alignment: Alignment.center, diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index 7582f07..59569be 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -15,6 +15,7 @@ import 'package:dio/dio.dart'; import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:shimmer/shimmer.dart'; import 'package:velocity_x/velocity_x.dart'; @@ -61,6 +62,7 @@ class _HomePageState extends State { List _todoModelList; List _anounceMentList; bool _onload = true; + EasyRefreshController _refreshController; ///自定义bar的菜单按钮 Widget _menuButton(String assetPath, String text, Widget page) { @@ -152,17 +154,7 @@ class _HomePageState extends State { SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( statusBarColor: Colors.transparent, )); - Future.delayed(Duration(milliseconds: 300), () async { - final userProvider = Provider.of(context, listen: false); - if (userProvider.isLogin) { - _itemNumModel = await _getItemNum(); - var dataList = await BussinessFunc.getBussinessModelList(1); - _todoModelList = dataList.map((e) => ToDoModel.fromJson(e)).toList(); - _anounceMentList = await _getAnouncement(); - _onload = false; - setState(() {}); - } - }); + _refreshController = EasyRefreshController(); } int _currentIndicator = 0; @@ -407,227 +399,253 @@ class _HomePageState extends State { ), ), //需要重构 - body: (!UserTool.userProvider.isLogin) - ? SizedBox() - : _onload - ? loadingWidget - : ListView( - padding: EdgeInsets.all(32.w), - children: [ - Container( - //公告标题行 - width: double.infinity, - height: 45.w, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - '今日公告', - style: TextStyle( - color: Color(0xFF4A4B51), - fontSize: 32.sp, - fontWeight: FontWeight.bold, + body: EasyRefresh( + firstRefresh: true, + header: MaterialHeader(), + controller: _refreshController, + onRefresh: () async { + final userProvider = + Provider.of(context, listen: false); + if (userProvider.isLogin) { + _itemNumModel = await _getItemNum(); + var dataList = await BussinessFunc.getBussinessModelList(1); + _todoModelList = + dataList.map((e) => ToDoModel.fromJson(e)).toList(); + _anounceMentList = await _getAnouncement(); + _onload = false; + setState(() {}); + } + }, + child: (!UserTool.userProvider.isLogin) + ? SizedBox() + : _onload + ? loadingWidget + : ListView( + padding: EdgeInsets.all(32.w), + children: [ + Container( + //公告标题行 + width: double.infinity, + height: 45.w, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + '今日公告', + style: TextStyle( + color: Color(0xFF4A4B51), + fontSize: 32.sp, + fontWeight: FontWeight.bold, + ), + ), + Spacer(), + AkuButton( + //全部公告按钮 + onPressed: () { + Get.to(() => AllAnouncement()); + }, + child: Row( + children: [ + Text( + '全部公告', + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 24.sp, + fontWeight: FontWeight.bold, + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 22.w, + color: AppStyle.minorTextColor, + ) + ], + ), + ), + ], + ), + ), + SizedBox(height: 16.w), + //公告栏 + Container( + color: Color(0xFFFFFFFF), + width: double.infinity, + height: 172.w, + child: Stack(children: [ + CarouselSlider( + items: _anounceMentList + .map( + (e) => AllAnouncementState.anounceCard(e)) + .toList(), + options: CarouselOptions( + viewportFraction: 1.0, + aspectRatio: 686 / 172, + autoPlay: true, + onPageChanged: (index, _) { + setState(() { + _currentIndicator = index; + }); + }, ), ), - Spacer(), - AkuButton( - //全部公告按钮 - onPressed: () { - Get.to(() => AllAnouncement()); - }, + Positioned( + top: 144.w, + left: 0, + bottom: 16.w, + right: 0, child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: _anounceMentList.map((e) { + int index = _anounceMentList.indexOf(e); + return Container( + width: 12.w, + height: 12.w, + margin: + EdgeInsets.symmetric(horizontal: 12.w), + decoration: BoxDecoration( + shape: BoxShape.circle, + color: _currentIndicator == index + ? Color(0xFFFFC40C) + : Color(0xFFE8E8E8), + ), + ); + }).toList(), + ), + ), + ]), + ), + SizedBox(height: 16.w), + //待办事项标题行 + !userProvider.isLogin + ? SizedBox() + : Row( children: [ Text( - '全部公告', + '待办事项', style: TextStyle( - color: AppStyle.minorTextColor, - fontSize: 24.sp, + color: Color(0xFF4A4B51), + fontSize: 32.sp, fontWeight: FontWeight.bold, ), ), - Icon( - Icons.arrow_forward_ios, - size: 22.w, - color: AppStyle.minorTextColor, - ) + Spacer(), + AkuButton( + padding: + EdgeInsets.symmetric(vertical: 16.w), + onPressed: () { + Get.to(BusinessPage(initIndex: 3)); + }, + child: Row( + children: [ + Text( + '全部事项', + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 24.sp, + fontWeight: FontWeight.bold), + ), + Icon( + Icons.arrow_forward_ios, + size: 22.w, + color: AppStyle.minorTextColor, + ), + ], + ), + ), ], ), - ), - ], - ), - ), - SizedBox(height: 16.w), - //公告栏 - Container( - color: Color(0xFFFFFFFF), - width: double.infinity, - height: 172.w, - child: Stack(children: [ - CarouselSlider( - items: _anounceMentList - .map((e) => AllAnouncementState.anounceCard(e)) - .toList(), - options: CarouselOptions( - viewportFraction: 1.0, - aspectRatio: 686 / 172, - autoPlay: true, - onPageChanged: (index, _) { - setState(() { - _currentIndicator = index; - }); - }, - ), - ), - Positioned( - top: 144.w, - left: 0, - bottom: 16.w, - right: 0, - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: _anounceMentList.map((e) { - int index = _anounceMentList.indexOf(e); - return Container( - width: 12.w, - height: 12.w, - margin: - EdgeInsets.symmetric(horizontal: 12.w), - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _currentIndicator == index - ? Color(0xFFFFC40C) - : Color(0xFFE8E8E8), - ), - ); - }).toList(), - ), - ), - ]), - ), - SizedBox(height: 16.w), - //待办事项标题行 - !userProvider.isLogin - ? SizedBox() - : Row( - children: [ - Text( - '待办事项', - style: TextStyle( - color: Color(0xFF4A4B51), - fontSize: 32.sp, - fontWeight: FontWeight.bold, - ), - ), - Spacer(), - AkuButton( - padding: EdgeInsets.symmetric(vertical: 16.w), - onPressed: () { - Get.to(BusinessPage(initIndex: 3)); + SizedBox(height: 16.w), + //待办事项栏 + !userProvider.isLogin + ? SizedBox() + : Container( + height: 500.w, + child: ListView.separated( + padding: EdgeInsets.zero, + separatorBuilder: (context, index) { + return AkuBox.w(16); }, - child: Row( - children: [ - Text( - '全部事项', - style: TextStyle( - color: AppStyle.minorTextColor, - fontSize: 24.sp, - fontWeight: FontWeight.bold), - ), - Icon( - Icons.arrow_forward_ios, - size: 22.w, - color: AppStyle.minorTextColor, + scrollDirection: Axis.horizontal, + itemBuilder: (context, index) { + return Container( + width: 526.w, + child: Builder( + builder: (context) { + if (_todoModelList[index] + .dynamicModel + .runtimeType == + BussinessAndFixModel) { + return BusinessFixCard( + callRefresh: () { + _refreshController + .callRefresh(); + }, + model: _todoModelList[index] + .dynamicModel); + } else if (_todoModelList[index] + .dynamicModel + .runtimeType == + ToDoOutDoorModel) { + return ToDoOutDoorCard( + model: _todoModelList[index] + .dynamicModel, + ); + } else + return SizedBox(); + }, ), - ], - ), + ); + }, + itemCount: _todoModelList.length, ), - ], - ), - SizedBox(height: 16.w), - //待办事项栏 - !userProvider.isLogin - ? SizedBox() - : Container( - height: 480.w, - child: ListView.separated( - separatorBuilder: (context, index) { - return AkuBox.w(16); - }, - scrollDirection: Axis.horizontal, - itemBuilder: (context, index) { - return Container( - width: 526.w, - child: Builder( - builder: (context) { - if (_todoModelList[index] - .dynamicModel - .runtimeType == - BussinessAndFixModel) { - return BusinessFixCard( - model: _todoModelList[index] - .dynamicModel); - } else if (_todoModelList[index] - .dynamicModel - .runtimeType == - ToDoOutDoorModel) { - return ToDoOutDoorCard( - model: _todoModelList[index] - .dynamicModel, - ); - } else - return SizedBox(); - }, - ), - ); - }, - itemCount: _todoModelList.length, ), - ), - SizedBox(height: 24.w), - //底部信息栏 - !userProvider.isLogin - ? SizedBox() - : Container( - width: double.infinity, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8.w), - color: Colors.white, - ), - child: Column( - children: [ - Row( - children: [ - _card(_itemNumModel.unProcessedNum ?? 0, - '未处理事项', Color(0xFFFF4E0D), 0), + SizedBox(height: 24.w), + //底部信息栏 + !userProvider.isLogin + ? SizedBox() + : Container( + width: double.infinity, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8.w), + color: Colors.white, + ), + child: Column( + children: [ + Row( + children: [ + _card(_itemNumModel.unProcessedNum ?? 0, + '未处理事项', Color(0xFFFF4E0D), 0), + GridientDiveder() + .verticalDivider(166.5.w), + _card(_itemNumModel.processingNum ?? 0, + '处理中事项', Color(0xFFFFC40C), 1), + ], + ), + Row(children: [ GridientDiveder() - .verticalDivider(166.5.w), - _card(_itemNumModel.processingNum ?? 0, - '处理中事项', Color(0xFFFFC40C), 1), - ], - ), - Row(children: [ - GridientDiveder().horizontalDivider(343.w), - GridientDiveder(isReverse: true) - .horizontalDivider(343.w) - ]), - Row( - children: [ - _card(_itemNumModel.processedNum ?? 0, - '已处理事项', Color(0xFF3F8FFE), 2), + .horizontalDivider(343.w), GridientDiveder(isReverse: true) - .verticalDivider( - 166.5.w, - ), - _card(_itemNumModel.allNum ?? 0, '全部事项', - Color(0xFF333333), 3), - ], - ), - ], + .horizontalDivider(343.w) + ]), + Row( + children: [ + _card(_itemNumModel.processedNum ?? 0, + '已处理事项', Color(0xFF3F8FFE), 2), + GridientDiveder(isReverse: true) + .verticalDivider( + 166.5.w, + ), + _card(_itemNumModel.allNum ?? 0, '全部事项', + Color(0xFF333333), 3), + ], + ), + ], + ), ), - ), - ], - ), + ], + ), + ), ), value: SystemUiOverlayStyle.dark, ); diff --git a/lib/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart b/lib/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart index fb70c57..1483e07 100644 --- a/lib/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart +++ b/lib/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart @@ -42,7 +42,6 @@ class BusinessAndFixDetailPage extends StatefulWidget { } class _BusinessAndFixDetailPageState extends State { - bool get isHandOut => widget.model.status == 1; FixedDetailModel _detailModel; bool _onload = true; @@ -138,7 +137,7 @@ class _BusinessAndFixDetailPageState extends State { ), ); } else if (widget.model.status == 2) { - if (userProvider.infoModel.canSendTicket){ + if (userProvider.infoModel.canSendTicket) { return AkuMaterialButton( color: AppStyle.primaryColor, nullColor: AppStyle.minorColor, @@ -204,9 +203,10 @@ class _BusinessAndFixDetailPageState extends State { color: AppStyle.primaryColor, ), ), - onPressed: () { - Get.to( + onPressed: () async { + await Get.to( FixMoreTimePage(dispatchId: widget.model.dispatchId)); + _easyRefreshController.callRefresh(); }, child: Text( '申请延时', @@ -404,7 +404,7 @@ class _BusinessAndFixDetailPageState extends State { title: '报修进程', children: _detailModel.processRecord.map((e) { return _buildProcessTile( - AkuMap.operationType[e.operationType], + AkuMap.operationType(e.operationType), DateUtil.formatDateStr(e.operationDate, format: 'yyyy-MM-dd HH:mm:ss'), ); diff --git a/lib/ui/sub_pages/business_and_fix/business_fix_card.dart b/lib/ui/sub_pages/business_and_fix/business_fix_card.dart index ff0853c..4e3bbd3 100644 --- a/lib/ui/sub_pages/business_and_fix/business_fix_card.dart +++ b/lib/ui/sub_pages/business_and_fix/business_fix_card.dart @@ -25,11 +25,16 @@ class BusinessFixCard extends StatefulWidget { final BussinessAndFixModel model; final bool homeDisplay; final bool canSeeBottomButton; + final VoidCallback callRefresh; + //是否是报事保修处理完成页面调用 + final bool hasFinished; BusinessFixCard( {Key key, @required this.model, this.homeDisplay = false, - this.canSeeBottomButton = true}) + this.canSeeBottomButton = true, + this.callRefresh, + this.hasFinished = false}) : super(key: key); @override @@ -70,8 +75,11 @@ class _BusinessFixCardState extends State { @override Widget build(BuildContext context) { return GestureDetector( - onTap: () { - Get.to(() => BusinessAndFixDetailPage(model: widget.model)); + onTap: () async { + await Get.to(() => BusinessAndFixDetailPage(model: widget.model)); + if (widget.callRefresh != null) { + widget.callRefresh(); + } }, child: Container( padding: EdgeInsets.all(24.w), @@ -93,13 +101,17 @@ class _BusinessFixCardState extends State { ), ), Text( - AkuMap.fixStatus(userInfoModel.canSendTicket, - userInfoModel.canPickUpTicket, widget.model.status), - style: TextStyle( - color: widget.model.status < 4 - ? Color(0XFFFF4501) - : AppStyle.minorTextColor, - ), + widget.hasFinished + ? '已处理' + : AkuMap.fixStatus(userInfoModel.canSendTicket, + userInfoModel.canPickUpTicket, widget.model.status), + style: widget.hasFinished + ? TextStyle(color: AppStyle.minorTextColor) + : TextStyle( + color: widget.model.status < 4 + ? Color(0XFFFF4501) + : AppStyle.minorTextColor, + ), ), ], ), @@ -194,8 +206,8 @@ class _BusinessFixCardState extends State { widget.model.status == 3 ? AkuBox.w(24) : SizedBox(), widget.model.status == 3 ? AkuMaterialButton( - onPressed: () { - Get.to(() => BusinessAndFixDetailPage( + onPressed: () async { + await Get.to(() => BusinessAndFixDetailPage( model: widget.model, )); }, @@ -214,7 +226,7 @@ class _BusinessFixCardState extends State { : SizedBox(), (widget.model.status == 2) && (userInfoModel.canPickUpTicket) ? AkuMaterialButton( - onPressed: () { + onPressed: () async { // final userProvider = // Provider.of(context, listen: false); // widget.model.detail.fixStatuses.add(FixStatus( @@ -223,9 +235,12 @@ class _BusinessFixCardState extends State { // )); // widget.model.type = FIX_ENUM.PROCESSING; // Get.back(); - Get.to(() => BusinessAndFixDetailPage( + await Get.to(() => BusinessAndFixDetailPage( model: widget.model, )); + if (widget.callRefresh != null) { + widget.callRefresh(); + } }, radius: 4.w, color: AppStyle.primaryColor, @@ -252,8 +267,11 @@ class _BusinessFixCardState extends State { alignment: Alignment.centerRight, child: AkuMaterialButton( height: 64.w, - onPressed: () { + onPressed: () async { Get.to(() => BusinessAndFixDetailPage(model: widget.model)); + if (widget.callRefresh != null) { + widget.callRefresh(); + } }, radius: 4, color: AppStyle.primaryColor, diff --git a/lib/ui/sub_pages/business_and_fix/bussiness_and_fix_view.dart b/lib/ui/sub_pages/business_and_fix/bussiness_and_fix_view.dart index 0a837fc..b1761c7 100644 --- a/lib/ui/sub_pages/business_and_fix/bussiness_and_fix_view.dart +++ b/lib/ui/sub_pages/business_and_fix/bussiness_and_fix_view.dart @@ -47,7 +47,11 @@ class _BussinessAndFixViewState extends State builder: (items) { return ListView.separated( itemBuilder: (context, index) { - return BusinessFixCard(model: items[index]); + return BusinessFixCard( + model: items[index], + callRefresh: () { + _easyRefreshController.callRefresh(); + }); }, separatorBuilder: (_, __) { return 16.w.heightBox; diff --git a/lib/ui/sub_pages/business_and_fix/fix_submit_finish_page.dart b/lib/ui/sub_pages/business_and_fix/fix_submit_finish_page.dart index bd87dc7..a000003 100644 --- a/lib/ui/sub_pages/business_and_fix/fix_submit_finish_page.dart +++ b/lib/ui/sub_pages/business_and_fix/fix_submit_finish_page.dart @@ -23,6 +23,7 @@ class FixSubmitFinishPage extends StatelessWidget { '您已处理完成该报修'.text.black.size(40.sp).bold.make(), 120.w.heightBox, BusinessFixCard( + hasFinished: true, model: this.model, canSeeBottomButton: false, ), diff --git a/lib/ui/sub_pages/business_and_fix/fix_work_finish_page.dart b/lib/ui/sub_pages/business_and_fix/fix_work_finish_page.dart index 3b9972a..47b99ef 100644 --- a/lib/ui/sub_pages/business_and_fix/fix_work_finish_page.dart +++ b/lib/ui/sub_pages/business_and_fix/fix_work_finish_page.dart @@ -289,76 +289,97 @@ class _FixWorkFinishPageState extends State { title: '费用明细', spacing: 16, children: [ - Row( - children: [ - AkuBox.h(96), - Text('人工费'), - Expanded( - child: TextField( - controller: _humanController, - onChanged: (_) => setState(() {}), - keyboardType: TextInputType.number, - textAlign: TextAlign.end, - decoration: InputDecoration( - border: InputBorder.none, - hintText: '请输入', - hintStyle: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 28.sp, - color: AppStyle.minorTextColor, + SizedBox( + height: 96.w, + child: Row( + children: [ + Text( + '人工费', + style: + TextStyle(color: Colors.black, fontSize: 28.sp), + ), + Expanded( + child: TextField( + controller: _humanController, + onChanged: (_) => setState(() {}), + keyboardType: TextInputType.number, + textAlign: TextAlign.end, + decoration: InputDecoration( + border: InputBorder.none, + hintText: '请输入', + hintStyle: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 28.sp, + color: AppStyle.minorTextColor, + ), ), ), ), - ), - ], + ], + ), ), Divider(height: 1.w), - Row( - children: [ - AkuBox.h(96), - Text('材料费'), - Expanded( - child: TextField( - onChanged: (_) => setState(() {}), - controller: _materialPriceController, - textAlign: TextAlign.end, - keyboardType: TextInputType.number, - decoration: InputDecoration( - border: InputBorder.none, - hintText: '请输入', - hintStyle: TextStyle( - fontWeight: FontWeight.bold, - fontSize: 28.sp, - color: AppStyle.minorTextColor, + SizedBox( + height: 96.w, + child: Row( + children: [ + Text( + '材料费', + style: + TextStyle(color: Colors.black, fontSize: 28.sp), + ), + Expanded( + child: TextField( + onChanged: (_) => setState(() {}), + controller: _materialPriceController, + textAlign: TextAlign.end, + keyboardType: TextInputType.number, + decoration: InputDecoration( + border: InputBorder.none, + hintText: '请输入', + hintStyle: TextStyle( + fontWeight: FontWeight.bold, + fontSize: 28.sp, + color: AppStyle.minorTextColor, + ), ), ), ), - ), - ], + ], + ), ), Divider(height: 1.w), - Row( - children: [ - AkuBox.h(96), - Text('总计费用'), - Spacer(), - Builder( - builder: (context) { - if (TextUtil.isEmpty(_humanController.text) || - TextUtil.isEmpty( - _materialPriceController.text)) { - return Text('人工费或材料费不能为空'); - } else { - humanPrice = - double.tryParse(_humanController.text); - materialPrice = double.tryParse( - _materialPriceController.text); - } - return Text( - '¥${(humanPrice + materialPrice).toStringAsFixed(2)}'); - }, - ), - ], + SizedBox( + height: 96.w, + child: Row( + children: [ + Text( + '总计费用', + style: + TextStyle(color: Colors.black, fontSize: 28.sp), + ), + Spacer(), + Builder( + builder: (context) { + if (TextUtil.isEmpty(_humanController.text) || + TextUtil.isEmpty( + _materialPriceController.text)) { + return Text('人工费或材料费不能为空'); + } else { + humanPrice = + double.tryParse(_humanController.text); + materialPrice = double.tryParse( + _materialPriceController.text); + } + return Text( + '¥${(humanPrice + materialPrice).toStringAsFixed(2)}', + style: TextStyle( + color: Colors.black, fontSize: 28.sp), + ); + }, + ), + ], + ), ), ], ), @@ -409,6 +430,7 @@ class _FixWorkFinishPageState extends State { if (baseModel.status) { FixSubmitFinishPage( model: widget.fixModel, + ).to(); } else { BotToast.showText(text: baseModel.message); diff --git a/pubspec.lock b/pubspec.lock index 0fb282f..18d2766 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,7 +5,7 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "21.0.0" aku_ui: @@ -21,322 +21,329 @@ packages: dependency: "direct main" description: name: amap_flutter_base - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" amap_flutter_location: dependency: "direct main" description: name: amap_flutter_location - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" amap_flutter_map: dependency: "direct main" description: name: amap_flutter_map - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" analyzer: dependency: transitive description: name: analyzer - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.5.0" animator: dependency: transitive description: name: animator - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" args: dependency: transitive description: name: args - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.5.0" auto_size_text: dependency: transitive description: name: auto_size_text - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0-nullsafety.0" auto_size_text_pk: dependency: transitive description: name: auto_size_text_pk - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" badges: dependency: "direct main" description: name: badges - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "2.0.0-nullsafety.1" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" bot_toast: dependency: "direct main" description: name: bot_toast - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.1" build: dependency: transitive description: name: build - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" build_config: dependency: transitive description: name: build_config - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" carousel_slider: dependency: "direct main" description: name: carousel_slider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0-nullsafety.0" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" checked_yaml: dependency: transitive description: name: checked_yaml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" cli_util: dependency: transitive description: name: cli_util - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.15.0" common_utils: dependency: "direct main" description: name: common_utils - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" convert: dependency: transitive description: name: convert - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" dart_style: dependency: transitive description: name: dart_style - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" decimal: dependency: transitive description: name: decimal - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" device_info_plus: dependency: transitive description: name: device_info_plus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" device_info_plus_linux: dependency: transitive description: name: device_info_plus_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" device_info_plus_macos: dependency: transitive description: name: device_info_plus_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" device_info_plus_platform_interface: dependency: transitive description: name: device_info_plus_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" device_info_plus_web: dependency: transitive description: name: device_info_plus_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" device_info_plus_windows: dependency: transitive description: name: device_info_plus_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" dio: dependency: "direct main" description: name: dio - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" dotted_border: dependency: "direct main" description: name: dotted_border - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" expandable: dependency: "direct main" description: name: expandable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.1" + extended_list_library: + dependency: transitive + description: + name: extended_list_library + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.0" extended_text: dependency: "direct main" description: name: extended_text - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.5" extended_text_library: dependency: transitive description: name: extended_text_library - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.2" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" file: dependency: transitive description: name: file - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.0" firebase_core: dependency: "direct main" description: name: firebase_core - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.1" firebase_core_web: dependency: transitive description: name: firebase_core_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.3" firebase_crashlytics: dependency: "direct main" description: name: firebase_crashlytics - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.3" firebase_crashlytics_platform_interface: dependency: transitive description: name: firebase_crashlytics_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.3" flutter: @@ -348,14 +355,14 @@ packages: dependency: "direct main" description: name: flutter_easyrefresh - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" flutter_highlight: dependency: transitive description: name: flutter_highlight - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.0" flutter_localizations: @@ -367,21 +374,21 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" flutter_rating_bar: dependency: "direct main" description: name: flutter_rating_bar - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" flutter_screenutil: dependency: "direct main" description: name: flutter_screenutil - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0+2" flutter_test: @@ -398,91 +405,91 @@ packages: dependency: "direct main" description: name: get - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.4" glob: dependency: transitive description: name: glob - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" grinder: dependency: "direct dev" description: name: grinder - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.9.0" highlight: dependency: transitive description: name: highlight - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.0" hive: dependency: "direct main" description: name: hive - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.6.0-nullsafety.2" hive_flutter: dependency: "direct main" description: name: hive_flutter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.1" http: dependency: transitive description: name: http - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.13.3" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" image_picker: dependency: "direct main" description: name: image_picker - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.5" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" image_picker_platform_interface: dependency: transitive description: name: image_picker_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" import_sorter: dependency: "direct dev" description: name: import_sorter - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.5.1" intl: dependency: transitive description: name: intl - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.17.0" jpush_flutter: @@ -498,224 +505,224 @@ packages: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.3" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.1" json_serializable: dependency: "direct main" description: name: json_serializable - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.1" logger: dependency: "direct main" description: name: logger - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" logging: dependency: transitive description: name: logging - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.12.10" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" package_config: dependency: transitive description: name: package_config - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" package_info_plus: dependency: transitive description: name: package_info_plus - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" package_info_plus_linux: dependency: transitive description: name: package_info_plus_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" package_info_plus_macos: dependency: transitive description: name: package_info_plus_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" package_info_plus_web: dependency: transitive description: name: package_info_plus_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" package_info_plus_windows: dependency: transitive description: name: package_info_plus_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.0" path_drawing: dependency: transitive description: name: path_drawing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.5.1" path_parsing: dependency: transitive description: name: path_parsing - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1" path_provider: dependency: transitive description: name: path_provider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" pedantic: dependency: "direct dev" description: name: pedantic - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.11.0" permission_handler: dependency: "direct main" description: name: permission_handler - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.3" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.3.0" pin_input_text_field: dependency: "direct main" description: name: pin_input_text_field - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.0" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" power_logger: dependency: "direct main" description: name: power_logger - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" provider: dependency: "direct main" description: name: provider - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0" pub_semver: dependency: transitive description: name: pub_semver - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" pubspec_parse: dependency: transitive description: name: pubspec_parse - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" qr_code_scanner: dependency: "direct main" description: name: qr_code_scanner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0" rational: dependency: transitive description: name: rational - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0+1" shimmer: dependency: "direct main" description: name: shimmer - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" sky_engine: @@ -727,161 +734,168 @@ packages: dependency: transitive description: name: source_gen - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" source_span: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.8.0" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.10.0" states_rebuilder: dependency: transitive description: name: states_rebuilder - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.0" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.19" tint: dependency: transitive description: name: tint - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.0" url_launcher: dependency: "direct main" description: name: url_launcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "6.0.3" url_launcher_linux: dependency: transitive description: name: url_launcher_linux - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.2" url_launcher_web: dependency: transitive description: name: url_launcher_web - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" url_launcher_windows: dependency: transitive description: name: url_launcher_windows - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.0" velocity_x: dependency: "direct main" description: name: velocity_x - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.6.1" vxstate: dependency: transitive description: name: vxstate - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" watcher: dependency: transitive description: name: watcher - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" + waterfall_flow: + dependency: "direct main" + description: + name: waterfall_flow + url: "https://pub.flutter-io.cn" + source: hosted + version: "3.0.1" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.5" yaml: dependency: transitive description: name: yaml - url: "https://pub.dartlang.org" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" sdks: diff --git a/pubspec.yaml b/pubspec.yaml index 6db36d6..3223aac 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: A new Flutter application. publish_to: "none" -version: 1.0.8+9 +version: 1.5.0+10 environment: sdk: ">=2.7.0 <3.0.0" @@ -55,6 +55,8 @@ dependencies: firebase_crashlytics: ^2.0.0 #json序列化 json_serializable: ^4.1.1 + #瀑布流 + waterfall_flow: ^3.0.1 power_logger: ^1.0.1-nullsafety.1 logger: ^1.0.0 @@ -69,7 +71,7 @@ dependencies: url: https://git.oa00.com/flutter_third/jpush-flutter-plugin shimmer: ^2.0.0-nullsafety.0 - badges: ^1.2.0 + badges: ^2.0.0-nullsafety.1 dev_dependencies: flutter_test: