diff --git a/assets/images/contact_manager.png b/assets/images/contact_manager.png new file mode 100644 index 00000000..ad71c510 Binary files /dev/null and b/assets/images/contact_manager.png differ diff --git a/lib/const/resource.dart b/lib/const/resource.dart index e8260d30..6eaf8755 100644 --- a/lib/const/resource.dart +++ b/lib/const/resource.dart @@ -478,6 +478,10 @@ class R { static const String ASSETS_IMAGES_COMMITMENT_PNG = 'assets/images/commitment.png'; + /// ![preview](file:///Users/zhangmeng/aku_community/assets/images/contact_manager.png) + static const String ASSETS_IMAGES_CONTACT_MANAGER_PNG = + 'assets/images/contact_manager.png'; + /// ![preview](file:///Users/zhangmeng/aku_community/assets/images/drawings.png) static const String ASSETS_IMAGES_DRAWINGS_PNG = 'assets/images/drawings.png'; diff --git a/lib/constants/api.dart b/lib/constants/api.dart index b8012974..bd2c455e 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -392,6 +392,9 @@ class _Upload { ///上传租赁有效(正式)合同pdf String get uploadFormalContract => '/user/upload/uploadLeaseContractValidPdf'; + + ///上传腾空单 + String get uploadClearingSingle => '/user/upload/uploadAppClearingSingle'; } class _Message { @@ -487,4 +490,8 @@ class _House { ///我的房屋:提交租赁审核信息 String get submitFormalContract => '/user/myHouse/submitAudit'; + + ///我的房屋-终止合同:提交终止申请 + String get submitTerminateApplication => + '/user/myHouse/submitTerminateApplication'; } diff --git a/lib/generated_plugin_registrant.dart b/lib/generated_plugin_registrant.dart index 8e0b1cb0..222a4e7a 100644 --- a/lib/generated_plugin_registrant.dart +++ b/lib/generated_plugin_registrant.dart @@ -6,12 +6,13 @@ import 'package:device_info_plus_web/device_info_plus_web.dart'; import 'package:firebase_core_web/firebase_core_web.dart'; -import 'package:flutter_web_plugins/flutter_web_plugins.dart'; import 'package:image_picker_for_web/image_picker_for_web.dart'; import 'package:package_info_plus_web/package_info_plus_web.dart'; import 'package:shared_preferences_web/shared_preferences_web.dart'; import 'package:url_launcher_web/url_launcher_web.dart'; +import 'package:flutter_web_plugins/flutter_web_plugins.dart'; + // ignore: public_member_api_docs void registerPlugins(Registrar registrar) { DeviceInfoPlusPlugin.registerWith(registrar); diff --git a/lib/models/house/lease_detail_model.dart b/lib/models/house/lease_detail_model.dart index 2c6eff0a..52190de7 100644 --- a/lib/models/house/lease_detail_model.dart +++ b/lib/models/house/lease_detail_model.dart @@ -34,6 +34,10 @@ class LeaseDetailModel extends Equatable { final String? payBank; final String? bankAccountName; final String? bankAccount; + final String? takeDate; + final String? notMeterRentDate; + final num? requiredRent; + final String? depositRefundReviewRemake; LeaseDetailModel({ required this.id, required this.code, @@ -62,6 +66,10 @@ class LeaseDetailModel extends Equatable { required this.payBank, required this.bankAccountName, required this.bankAccount, + this.takeDate, + this.notMeterRentDate, + this.requiredRent, + this.depositRefundReviewRemake, }); factory LeaseDetailModel.fromJson(Map json) => @@ -95,4 +103,37 @@ class LeaseDetailModel extends Equatable { bankAccount, ]; } + + String get statusString { + switch (this.status) { + case 1: + return '待签署'; + case 2: + return '待提交'; + case 3: + return '审核中'; + case 4: + return '已驳回'; + case 5: + return '待支付'; + case 6: + return '已完成'; + case 11: + return '申请终止合同'; + case 12: + return '申请终止失败'; + case 13: + return '申请终止成功'; + case 14: + return '已支付剩余租金'; + case 15: + return '申请退还保证金'; + case 16: + return '申请保证金退回'; + case 17: + return '申请退换保证金成功'; + default: + return '未知'; + } + } } diff --git a/lib/models/house/lease_detail_model.g.dart b/lib/models/house/lease_detail_model.g.dart index c96f1bc5..a2115157 100644 --- a/lib/models/house/lease_detail_model.g.dart +++ b/lib/models/house/lease_detail_model.g.dart @@ -37,5 +37,9 @@ LeaseDetailModel _$LeaseDetailModelFromJson(Map json) { payBank: json['payBank'] as String?, bankAccountName: json['bankAccountName'] as String?, bankAccount: json['bankAccount'] as String?, + takeDate: json['takeDate'] as String?, + notMeterRentDate: json['notMeterRentDate'] as String?, + requiredRent: json['requiredRent'] as num?, + depositRefundReviewRemake: json['depositRefundReviewRemake'] as String?, ); } diff --git a/lib/models/user/passed_house_list_model.dart b/lib/models/user/passed_house_list_model.dart index a6b46a6e..f0f66d57 100644 --- a/lib/models/user/passed_house_list_model.dart +++ b/lib/models/user/passed_house_list_model.dart @@ -1,6 +1,5 @@ -import 'package:flutter/material.dart'; - import 'package:equatable/equatable.dart'; +import 'package:flutter/material.dart'; import 'package:json_annotation/json_annotation.dart'; part 'passed_house_list_model.g.dart'; @@ -13,6 +12,7 @@ class PassedHouseListModel extends Equatable { final int type; final String? effectiveTimeStart; final String? effectiveTimeEnd; + final int? sysLeaseId; PassedHouseListModel({ required this.id, required this.estateId, @@ -20,6 +20,7 @@ class PassedHouseListModel extends Equatable { required this.type, this.effectiveTimeStart, this.effectiveTimeEnd, + this.sysLeaseId, }); @override diff --git a/lib/models/user/passed_house_list_model.g.dart b/lib/models/user/passed_house_list_model.g.dart index 2958db92..123ff0ce 100644 --- a/lib/models/user/passed_house_list_model.g.dart +++ b/lib/models/user/passed_house_list_model.g.dart @@ -14,5 +14,6 @@ PassedHouseListModel _$PassedHouseListModelFromJson(Map json) { type: json['type'] as int, effectiveTimeStart: json['effectiveTimeStart'] as String?, effectiveTimeEnd: json['effectiveTimeEnd'] as String?, + sysLeaseId: json['sysLeaseId'] as int?, ); } diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index 5b738f23..aeaee8ad 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -301,7 +301,11 @@ class _LifePayPageState extends State { if (items != null) _models = items as List; return Column( children: [ - HouseHeadCard(controller: _controller, context: context), + HouseHeadCard( + onChanged: () { + _controller!.callRefresh(); + }, + context: context), 16.w.heightBox, Container( padding: EdgeInsets.all(32.w), diff --git a/lib/painters/contact_manager_painter.dart b/lib/painters/contact_manager_painter.dart index 199d7e71..4ee99a83 100644 --- a/lib/painters/contact_manager_painter.dart +++ b/lib/painters/contact_manager_painter.dart @@ -19,6 +19,15 @@ class ContactManagerPainter extends CustomPainter { colors: [Color(0xFFF9F9F9), Color(0xFF4AFD71)]); paint.shader = gradient.createShader(rect); canvas.drawPath(path, paint); + rect= Rect.fromCircle(center: Offset(200.w, 200.w), radius: 150.w); + gradient = LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + colors: [Color(0xFFF9F9F9), Color(0xFF4AFD71)]); + Path path2 = Path(); + path2.addArc(rect, 0, pi * 2); + paint.shader = gradient.createShader(rect); + canvas.drawPath(path2, paint); } @override diff --git a/lib/provider/user_provider.dart b/lib/provider/user_provider.dart index 33658da0..84143736 100644 --- a/lib/provider/user_provider.dart +++ b/lib/provider/user_provider.dart @@ -40,7 +40,6 @@ class UserProvider extends ChangeNotifier { await appProvider.updateHouses(await HouseFunc.passedHouses); WebSocketUtil().setUser(userInfoModel!.id.toString()); WebSocketUtil().startWebSocket(); - AppProvider().setFireAlert(true); notifyListeners(); } catch (e) { LoggerData.addData(e); diff --git a/lib/ui/manager/questionnaire/submit_complish_page.dart b/lib/ui/manager/questionnaire/submit_complish_page.dart index 5d539cf8..0acb00be 100644 --- a/lib/ui/manager/questionnaire/submit_complish_page.dart +++ b/lib/ui/manager/questionnaire/submit_complish_page.dart @@ -23,7 +23,7 @@ class SubmitComplishPage extends StatelessWidget { child: Column( children: [ 76.w.heightBox, - FinishResultImage(status: status), + FinishResultImage(status: status!), 48.w.heightBox, (this.status! ? '提交成功' : '提交失败').text.size(36.sp).black.bold.make(), 16.w.heightBox, diff --git a/lib/ui/profile/house/contract_stop_page.dart b/lib/ui/profile/house/contract_stop_page.dart new file mode 100644 index 00000000..7725e59c --- /dev/null +++ b/lib/ui/profile/house/contract_stop_page.dart @@ -0,0 +1,50 @@ +import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/ui/profile/house/upload_empty_list_page.dart'; +import 'package:aku_community/utils/headers.dart'; +import 'package:aku_community/widget/buttons/bottom_button.dart'; +import 'package:flutter/material.dart'; + +import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:get/get.dart'; + +class ContractStopPage extends StatefulWidget { + ContractStopPage({Key? key,}) : super(key: key); + + @override + _ContractStopPageState createState() => _ContractStopPageState(); +} + +class _ContractStopPageState extends State { + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '联系物业', + body: Center( + child: Column( + children: [ + 192.w.heightBox, + Image.asset( + R.ASSETS_IMAGES_CONTACT_MANAGER_PNG, + width: 400.w, + height: 400.w, + ), + 40.w.heightBox, + '物业中心电话'.text.size(44.sp).color(ktextPrimary).bold.make(), + 32.w.heightBox, + '需沟通物业人员检查房屋\n并填写腾空单后拍照\n方可进行下一步' + .text + .size(30.w) + .color(ktextSubColor) + .align(TextAlign.center) + .make(), + ], + ), + ), + bottomNavi: BottomButton( + onPressed: () { + Get.off(() => UploadEmptyListPage()); + }, + child: '检查完成,上传腾空单'.text.size(32.sp).bold.color(ktextPrimary).make()), + ); + } +} diff --git a/lib/ui/profile/house/house_func.dart b/lib/ui/profile/house/house_func.dart index adf60f31..4ea4e3bb 100644 --- a/lib/ui/profile/house/house_func.dart +++ b/lib/ui/profile/house/house_func.dart @@ -185,6 +185,33 @@ class HouseFunc { } } + ///上传腾空单 + Future uploadClearingSingle(File file) async { + BaseFileModel baseFileModel = + await NetUtil().upload(API.upload.uploadClearingSingle, file); + if (baseFileModel.status ?? false) { + return baseFileModel.url!; + } else { + return ''; + } + } + + ///我的房屋终止合同:提交终止申请 + Future submitTerminationApplication( + int id, + String takeDate, + List urls, + ) async { + BaseModel baseModel = await NetUtil().post( + API.house.submitTerminateApplication, + params: {"id": id, "takeDate": takeDate, "clearingSingleImgUrl": urls}); + if (baseModel.status ?? false) { + return true; + } else { + return false; + } + } + static Map getSex = { '男': 1, '女': 2, diff --git a/lib/ui/profile/house/house_owners_page.dart b/lib/ui/profile/house/house_owners_page.dart index c786db84..bd82c7fa 100644 --- a/lib/ui/profile/house/house_owners_page.dart +++ b/lib/ui/profile/house/house_owners_page.dart @@ -1,3 +1,6 @@ +import 'package:aku_community/models/house/lease_detail_model.dart'; +import 'package:aku_community/ui/profile/house/contract_stop_page.dart'; +import 'package:aku_community/ui/profile/house/submit_finish_page.dart'; import 'package:flutter/material.dart'; import 'package:bot_toast/bot_toast.dart'; @@ -16,7 +19,6 @@ import 'package:aku_community/ui/profile/house/house_func.dart'; import 'package:aku_community/ui/profile/house/identify_selection_page.dart'; import 'package:aku_community/ui/profile/house/my_house_list.dart'; import 'package:aku_community/ui/profile/house/tenant_house_list_page.dart'; -import 'package:aku_community/ui/profile/house/upload_empty_form_page.dart'; import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/buttons/bottom_button.dart'; @@ -173,8 +175,7 @@ class _HouseOwnersPageState extends State { child: Text('添加房屋'), ), ), - if (!isOwner && !_emptyHouse) - _contractRelevant().expand() + if (!isOwner && !_emptyHouse) _contractRelevant() ], ), ), @@ -192,50 +193,77 @@ class _HouseOwnersPageState extends State { ///租客身份才会显示合同相关入口 Widget _contractRelevant() { - return GridView.count( - crossAxisCount: 2, - childAspectRatio: 326 / 241, - mainAxisSpacing: 32.w, - crossAxisSpacing: 32.w, - children: [ - _cardBuild(R.ASSETS_ICONS_PAY_PNG, '缴费查询', '查看租金及保证金情况', () {}), - _cardBuild(R.ASSETS_ICONS_CHANGE_PNG, '合同变更', '变更合同信息、重新签约', () {}), - _cardBuild(R.ASSETS_ICONS_CONTRACT_PNG, '合同续签', '到期前线上办理续签手续', () {}), - _cardBuild(R.ASSETS_ICONS_FINISH_PNG, '合同终止', '线上申请终止合同', () { - Get.to(() => UploadEmptyFormPage()); - }) - ], + return Container( + width: double.infinity, + height: 550.w, + padding: EdgeInsets.symmetric(horizontal: 32.w), + child: GridView.count( + crossAxisCount: 2, + childAspectRatio: 330 / 250, + mainAxisSpacing: 32.w, + crossAxisSpacing: 32.w, + children: [ + _cardBuild(R.ASSETS_ICONS_PAY_PNG, '缴费查询', '查看租金及保证金情况', () {}), + _cardBuild(R.ASSETS_ICONS_CHANGE_PNG, '合同变更', '变更合同信息、重新签约', () {}), + _cardBuild(R.ASSETS_ICONS_CONTRACT_PNG, '合同续签', '到期前线上办理续签手续', () {}), + _cardBuild(R.ASSETS_ICONS_FINISH_PNG, '合同终止', '线上申请终止合同', () async {}) + ], + ), ); } + Future stopContract() async { + LeaseDetailModel? model = await HouseFunc() + .leaseDetail(UserTool.appProveider.selectedHouse!.sysLeaseId!); + if (model != null) { + switch (model.status) { + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + Get.to(() => ContractStopPage()); + break; + case 11: + case 12: + case 13: + Get.to( + () => SubmitFinishPage(status: model.status, leaseId: model.id)); + break; + default: + } + } + } + Widget _cardBuild( String assetPath, String title, String subTitle, VoidCallback onPressed) { - return MaterialButton( - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.w)), - color: Colors.white, - elevation: 0, - minWidth: 326.w, - height: 241.w, - padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), - onPressed: onPressed, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Image.asset( - R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - width: 88.w, - height: 88.w, - ), - 16.w.heightBox, - title.text.size(28.sp).color(ktextPrimary).bold.make(), - 16.w.heightBox, - subTitle.text - .size(24.sp) - .color(ktextSubColor) - .maxLines(2) - .ellipsis - .make() - ], + return GestureDetector( + onTap: onPressed, + child: Container( + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(16.w)), + padding: EdgeInsets.only(left: 30.w, top: 24.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Image.asset( + R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + fit: BoxFit.fill, + width: 88.w, + height: 88.w, + ), + 16.w.heightBox, + title.text.size(28.sp).color(ktextPrimary).bold.make(), + 16.w.heightBox, + subTitle.text + .size(24.sp) + .color(ktextSubColor) + .maxLines(2) + .ellipsis + .make() + ], + ), ), ); } diff --git a/lib/ui/profile/house/pay_surplus_rent_page.dart b/lib/ui/profile/house/pay_surplus_rent_page.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/ui/profile/house/submit_finish_page.dart b/lib/ui/profile/house/submit_finish_page.dart new file mode 100644 index 00000000..e65c13d2 --- /dev/null +++ b/lib/ui/profile/house/submit_finish_page.dart @@ -0,0 +1,70 @@ +import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/models/house/lease_detail_model.dart'; +import 'package:aku_community/ui/profile/house/house_func.dart'; +import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:aku_community/widget/others/finish_result_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class SubmitFinishPage extends StatefulWidget { + final int status; + final int leaseId; + SubmitFinishPage({Key? key, required this.status, required this.leaseId}) + : super(key: key); + + @override + _SubmitFinishPageState createState() => _SubmitFinishPageState(); +} + +class _SubmitFinishPageState extends State { + String get statusString { + switch (widget.status) { + case 11: + return '审核中'; + case 12: + return '审核失败'; + case 13: + return '审核通过'; + default: + return '未知'; + } + } + + @override + Widget build(BuildContext context) { + return BeeScaffold( + body: Center( + child: Column( + children: [ + 76.w.heightBox, + FinishResultImage( + status: widget.status == 12 ? false : true, + haveInHandStatus: widget.status == 11 ? true : false, + ), + 48.w.heightBox, + statusString.text.black.size(36.sp).make(), + 96.w.heightBox, + widget.status != 13 + ? SizedBox() + : MaterialButton( + elevation: 0, + minWidth: 702.w, + height: 98.w, + color: kPrimaryColor, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.w)), + onPressed: () async { + LeaseDetailModel? model = + await HouseFunc().leaseDetail(widget.leaseId); + Get.back(); + }, + child: '去支付'.text.color(ktextPrimary).size(36.sp).make(), + ), + ], + ), + ), + ); + } +} diff --git a/lib/ui/profile/house/upload_contracts_page.dart b/lib/ui/profile/house/upload_contracts_page.dart index f111b778..5390a907 100644 --- a/lib/ui/profile/house/upload_contracts_page.dart +++ b/lib/ui/profile/house/upload_contracts_page.dart @@ -38,7 +38,7 @@ class _UploadContractsPageState extends State { 100.w.heightBox, UploadWidget( sheetTitle: '选择合同照片', - onPressed: (file) { + onPicked: (file) { _files.add(file); setState(() {}); }), diff --git a/lib/ui/profile/house/upload_empty_form_page.dart b/lib/ui/profile/house/upload_empty_form_page.dart deleted file mode 100644 index 978d2510..00000000 --- a/lib/ui/profile/house/upload_empty_form_page.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:flutter/material.dart'; - -import 'package:aku_community/painters/contact_manager_painter.dart'; -import 'package:aku_community/widget/bee_scaffold.dart'; - -class UploadEmptyFormPage extends StatefulWidget { - UploadEmptyFormPage({Key? key}) : super(key: key); - - @override - _UploadEmptyFormPageState createState() => _UploadEmptyFormPageState(); -} - -class _UploadEmptyFormPageState extends State { - @override - Widget build(BuildContext context) { - return BeeScaffold( - title: '联系物业', - body: Center( - child: Column( - children: [ - CustomPaint( - painter: ContactManagerPainter(), - ) - ], - ), - ), - ); - } -} diff --git a/lib/ui/profile/house/upload_empty_list_page.dart b/lib/ui/profile/house/upload_empty_list_page.dart new file mode 100644 index 00000000..b54d8715 --- /dev/null +++ b/lib/ui/profile/house/upload_empty_list_page.dart @@ -0,0 +1,91 @@ +import 'dart:io'; + +import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/ui/profile/house/house_func.dart'; +import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:aku_community/widget/buttons/bottom_button.dart'; +import 'package:aku_community/widget/others/bee_input_row.dart'; +import 'package:aku_community/widget/others/house_head_card.dart'; +import 'package:aku_community/widget/others/upload_widget.dart'; +import 'package:aku_community/widget/others/user_tool.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class UploadEmptyListPage extends StatefulWidget { + UploadEmptyListPage({Key? key}) : super(key: key); + + @override + _UploadEmptyListPageState createState() => _UploadEmptyListPageState(); +} + +class _UploadEmptyListPageState extends State { + File? _file; + List _urls = []; + int get sysLeaseId => UserTool.appProveider.selectedHouse!.sysLeaseId ?? 0; + late TextEditingController _editingController; + @override + void initState() { + super.initState(); + _editingController = TextEditingController(); + } + + @override + void dispose() { + _editingController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '提交终止申请', + body: ListView( + children: [ + HouseHeadCard(context: context), + 40.w.heightBox, + BeeInputRow( + title: '收房时间', + controller: _editingController, + hintText: '请填写收房时间'), + 40.w.heightBox, + '上传腾空单'.text.size(28.sp).color(ktextPrimary).make(), + 24.w.heightBox, + _file != null + ? Image.file( + _file!, + width: 480.w, + height: 480.w, + fit: BoxFit.cover, + ) + : UploadWidget( + sheetTitle: '上传腾空单', + onPicked: (file) { + _file = file; + setState(() {}); + }), + ], + ), + bottomNavi: BottomButton( + onPressed: () async { + Function cancel = BotToast.showLoading(); + if (_file != null) { + _urls.add(await HouseFunc().uploadClearingSingle(_file!)); + } else { + BotToast.showText(text: '请先选择腾空单'); + } + bool result = await HouseFunc().submitTerminationApplication( + sysLeaseId, _editingController.text, _urls); + if (result) { + Get.back(); + } else { + BotToast.showText(text: '提交失败'); + } + cancel(); + }, + child: '提交审核'.text.size(32.sp).bold.color(ktextPrimary).make()), + ); + } +} diff --git a/lib/utils/websocket/web_socket_util.dart b/lib/utils/websocket/web_socket_util.dart index 95ec100a..88ac82ed 100644 --- a/lib/utils/websocket/web_socket_util.dart +++ b/lib/utils/websocket/web_socket_util.dart @@ -107,6 +107,7 @@ class WebSocketUtil { } WebSocketUtil().setPrintHeart(true); + UserTool.appProveider.setFireAlert(true); } //接收消息回调 diff --git a/lib/widget/others/finish_result_image.dart b/lib/widget/others/finish_result_image.dart index e011c512..a5244d4a 100644 --- a/lib/widget/others/finish_result_image.dart +++ b/lib/widget/others/finish_result_image.dart @@ -9,10 +9,11 @@ class FinishResultImage extends StatelessWidget { const FinishResultImage({ Key? key, required this.status, + this.haveInHandStatus = false, }) : super(key: key); - final bool? status; - + final bool status; + final bool haveInHandStatus; @override Widget build(BuildContext context) { return Container( @@ -21,10 +22,18 @@ class FinishResultImage extends StatelessWidget { height: 110.w, decoration: BoxDecoration( borderRadius: BorderRadius.circular(55.w), - color: this.status! ? kPrimaryColor : kDangerColor, + color: this.haveInHandStatus + ? Colors.yellow.shade900 + : this.status + ? kPrimaryColor + : kDangerColor, ), child: Icon( - this.status! ? CupertinoIcons.checkmark : CupertinoIcons.multiply, + this.haveInHandStatus + ? CupertinoIcons.exclamationmark + : this.status + ? CupertinoIcons.checkmark + : CupertinoIcons.multiply, size: 70.w, color: Colors.white, ), diff --git a/lib/widget/others/house_head_card.dart b/lib/widget/others/house_head_card.dart index 3c6146f8..b04d653f 100644 --- a/lib/widget/others/house_head_card.dart +++ b/lib/widget/others/house_head_card.dart @@ -1,7 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; @@ -17,12 +16,11 @@ class HouseHeadCard extends StatelessWidget { const HouseHeadCard({ Key? key, required this.context, - required EasyRefreshController? controller, - }) : controller = controller, - super(key: key); + this.onChanged, + }) : super(key: key); final BuildContext context; - final EasyRefreshController? controller; + final VoidCallback? onChanged; @override Widget build(BuildContext context) { @@ -39,7 +37,7 @@ class HouseHeadCard extends StatelessWidget { GestureDetector( onTap: () { Get.to(() => PickMyHousePage()); - controller!.callRefresh(); + if (onChanged != null) onChanged!(); }, child: Row( children: [ diff --git a/lib/widget/others/upload_widget.dart b/lib/widget/others/upload_widget.dart index 5c6de682..4e6296c9 100644 --- a/lib/widget/others/upload_widget.dart +++ b/lib/widget/others/upload_widget.dart @@ -11,9 +11,9 @@ import 'package:aku_community/widget/picker/bee_image_picker.dart'; class UploadWidget extends StatelessWidget { final String sheetTitle; - final Function(File file) onPressed; + final Function(File file) onPicked; const UploadWidget( - {Key? key, required this.sheetTitle, required this.onPressed}) + {Key? key, required this.sheetTitle, required this.onPicked}) : super(key: key); @override @@ -22,7 +22,7 @@ class UploadWidget extends StatelessWidget { onTap: () async { File? _file = await BeeImagePicker.pick(title: sheetTitle); if (_file != null) { - onPressed(_file); + onPicked(_file); } }, child: Center(