From dd48a36746afae1136c137eb0853c9def6291f05 Mon Sep 17 00:00:00 2001 From: Daisy <> Date: Tue, 21 May 2024 11:07:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DN=E5=A4=A9=E6=9C=AA=E5=BC=80?= =?UTF-8?q?=E9=97=A8=E4=BB=A5=E5=8F=8A=E6=B7=BB=E5=8A=A0=E5=AE=B6=E4=BA=BA?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addFamily/addFamily_logic.dart | 64 ++++++++++--------- .../messageWarn/addFamily/addFamily_page.dart | 39 +++++------ .../nDaysUnopened/nDaysUnopened_logic.dart | 41 ++++++------ .../nDaysUnopened/nDaysUnopened_page.dart | 41 ++++++------ .../nDaysUnopened/nDaysUnopened_state.dart | 30 ++++----- .../value_added_services_real_name_page.dart | 31 +++++---- 6 files changed, 131 insertions(+), 115 deletions(-) diff --git a/lib/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart b/lib/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart index 878c7bb2..1f3ddf37 100755 --- a/lib/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart +++ b/lib/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart @@ -1,9 +1,6 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:star_lock/appRouters.dart'; -import 'package:star_lock/app_settings/app_colors.dart'; import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_state.dart'; +import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart'; import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart'; import 'package:star_lock/main/lockDetail/messageWarn/notificationMode/notificationMode_data.dart'; import 'package:star_lock/network/api_repository.dart'; @@ -13,17 +10,24 @@ class AddFamilyLogic extends BaseGetXController { final AddFamilyState state = AddFamilyState(); //添加开门通知 - void addLockNoticeSetting() async { - var entity = await ApiRepository.to.addLockNoticeSetting( + Future addLockNoticeSetting() async { + final MsgNotificationEntity entity = + await ApiRepository.to.addLockNoticeSetting( lockId: state.getLockId.value, noticeType: 10, settingValue: { 'openDoorId': state.lockUserKeys.value.currentOpenDoorID, 'openDoorType': state.lockUserKeys.value.currentKeyType, 'remark': state.lockUserKeys.value.currentKeyName ?? '', - 'noticeWay': [ - {'type': 'mail', 'accounts': getEmailAndSMSAccountList(true)}, - {'type': 'sms', 'accounts': getEmailAndSMSAccountList(false)} + 'noticeWay': >[ + { + 'type': 'mail', + 'accounts': getEmailAndSMSAccountList(true) + }, + { + 'type': 'sms', + 'accounts': getEmailAndSMSAccountList(false) + } ] }, ); @@ -34,8 +38,9 @@ class AddFamilyLogic extends BaseGetXController { } //更新开门通知 - void updateLockNoticeSetting() async { - var entity = await ApiRepository.to.updateLockNoticeSettingAccount( + Future updateLockNoticeSetting() async { + final OpenDoorNotifyEntity entity = + await ApiRepository.to.updateLockNoticeSettingAccount( lockNoticeSettingAccountId: state.familyData.value.id!, settingValue: { 'openDoorId': state.familyData.value.settingValue!.openDoorId!, @@ -52,8 +57,9 @@ class AddFamilyLogic extends BaseGetXController { } //删除开门通知 - void deleteLockNoticeSetting() async { - var entity = await ApiRepository.to.deleteLockNoticeSettingAccount( + Future deleteLockNoticeSetting() async { + final OpenDoorNotifyEntity entity = + await ApiRepository.to.deleteLockNoticeSettingAccount( lockNoticeSettingAccountId: state.familyData.value.id!, ); if (entity.errorCode!.codeIsSuccessful) { @@ -64,14 +70,14 @@ class AddFamilyLogic extends BaseGetXController { //获取到家人信息的请求数组 List getEmailAndSMSAccountList(bool isEmail) { - List list = []; + final List list = []; List accountList = []; isEmail ? accountList = state.emailReceiverList.value : accountList = state.phoneReceiverList.value; for (int i = 0; i < accountList.length; i++) { - MsgNoticeModeData item = accountList[i]; - Map map = {}; + final MsgNoticeModeData item = accountList[i]; + final Map map = {}; map['countryCode'] = isEmail ? 0 : item.countryCode; map['account'] = isEmail ? item.receiveEmail : item.receivePhone; list.add(map); @@ -83,9 +89,9 @@ class AddFamilyLogic extends BaseGetXController { String emailListStr = ''; if (val['emailReceiverList'] != null) { state.emailReceiverList.value = val['emailReceiverList']; - List emailReceiverList = state.emailReceiverList.value; + final List emailReceiverList = state.emailReceiverList.value; for (int i = 0; i < emailReceiverList.length; i++) { - MsgNoticeModeData item = emailReceiverList[i]; + final MsgNoticeModeData item = emailReceiverList[i]; emailListStr += item.receiveEmail; // 检查是否为最后一个元素 if (i < emailReceiverList.length - 1) { @@ -101,9 +107,9 @@ class AddFamilyLogic extends BaseGetXController { if (val['phoneReceiverList'] != null) { state.phoneReceiverList.value = val['phoneReceiverList']; - List phoneReceiverList = state.phoneReceiverList.value; + final List phoneReceiverList = state.phoneReceiverList.value; for (int i = 0; i < phoneReceiverList.length; i++) { - MsgNoticeModeData item = phoneReceiverList[i]; + final MsgNoticeModeData item = phoneReceiverList[i]; phoneListStr += item.receivePhone; // 检查是否为最后一个元素 if (i < phoneReceiverList.length - 1) { @@ -128,7 +134,7 @@ class AddFamilyLogic extends BaseGetXController { //当前钥匙类型 1:电子钥匙 2:密码钥匙 3:指纹钥匙 4:卡钥匙 5:人脸钥匙 String getKeyTypeStr() { - int keyType = state.familyData.value.settingValue!.openDoorType!; + final int keyType = state.familyData.value.settingValue!.openDoorType!; switch (keyType) { case 1: return '电子钥匙'; @@ -147,24 +153,24 @@ class AddFamilyLogic extends BaseGetXController { //根据列表返回值得到邮箱、手机列表 Map> getAccountsMap() { - List mailAccounts = []; - List smsAccounts = []; + final List mailAccounts = []; + final List smsAccounts = []; if (state.familyData.value.settingValue != null) { - for (NoticeWay item + for (final NoticeWay item in state.familyData.value.settingValue!.noticeWayList!) { if (item.type == 'mail' && item.accounts != null) { - for (Accounts account in item.accounts!) { + for (final Accounts account in item.accounts!) { if (account.account != null) { - MsgNoticeModeData msgNoticeModeData = MsgNoticeModeData(); + final MsgNoticeModeData msgNoticeModeData = MsgNoticeModeData(); msgNoticeModeData.receiveEmail = account.account!; mailAccounts.add(msgNoticeModeData); } } } else if (item.type == 'sms' && item.accounts != null) { - for (Accounts account in item.accounts!) { + for (final Accounts account in item.accounts!) { if (account.account != null && account.countryCode != null) { - MsgNoticeModeData msgNoticeModeData = MsgNoticeModeData(); + final MsgNoticeModeData msgNoticeModeData = MsgNoticeModeData(); msgNoticeModeData.receivePhone = account.account!; msgNoticeModeData.countryCode = account.countryCode!; smsAccounts.add(msgNoticeModeData); @@ -174,7 +180,7 @@ class AddFamilyLogic extends BaseGetXController { } } - return { + return >{ 'emailReceiverList': mailAccounts, 'phoneReceiverList': smsAccounts, }; diff --git a/lib/main/lockDetail/messageWarn/addFamily/addFamily_page.dart b/lib/main/lockDetail/messageWarn/addFamily/addFamily_page.dart index 1ea9edab..98259c99 100755 --- a/lib/main/lockDetail/messageWarn/addFamily/addFamily_page.dart +++ b/lib/main/lockDetail/messageWarn/addFamily/addFamily_page.dart @@ -4,8 +4,10 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/appRouters.dart'; import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart'; -import 'package:star_lock/tools/showCupertinoAlertView.dart'; +import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_state.dart'; +import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart'; import 'package:star_lock/tools/commonItem.dart'; +import 'package:star_lock/tools/showCupertinoAlertView.dart'; import 'package:star_lock/tools/showTFView.dart'; import 'package:star_lock/tools/storage.dart'; import 'package:star_lock/tools/submitBtn.dart'; @@ -22,8 +24,8 @@ class AddFamilyPage extends StatefulWidget { } class _AddFamilyPageState extends State { - final logic = Get.put(AddFamilyLogic()); - final state = Get.find().state; + final AddFamilyLogic logic = Get.put(AddFamilyLogic()); + final AddFamilyState state = Get.find().state; @override Widget build(BuildContext context) { @@ -36,7 +38,7 @@ class _AddFamilyPageState extends State { body: Container( padding: EdgeInsets.all(30.w), child: Column( - children: [ + children: [ Obx(() => CommonItem( leftTitel: '开门方式'.tr, rightTitle: state.isDetail.value @@ -46,9 +48,9 @@ class _AddFamilyPageState extends State { isHaveDirection: true, action: () { //锁用户 - Get.toNamed(Routers.lockUserPage, - arguments: {'getLockId': state.getLockId.value}) - ?.then((val) { + Get.toNamed(Routers.lockUserPage, arguments: { + 'getLockId': state.getLockId.value + })?.then((val) { if (val != null) { state.lockUserKeys.value = val; } @@ -73,8 +75,9 @@ class _AddFamilyPageState extends State { GestureDetector( onTap: () { Get.toNamed(Routers.notificationModePage, - arguments: {'familyData': state.familyData.value}) - ?.then((val) { + arguments: { + 'familyData': state.familyData.value + })?.then((val) { if (val != null) { state.emailListStr.value = logic.getEmailListStr(val); state.phontListStr.value = logic.getPhoneListStr(val); @@ -85,10 +88,10 @@ class _AddFamilyPageState extends State { color: Colors.white, margin: EdgeInsets.only(bottom: 10.h), child: Column( - children: [ + children: [ CommonItem( leftTitel: '提醒方式'.tr, - rightTitle: "", + rightTitle: '', isHaveLine: false, isHaveRightWidget: false, isHaveDirection: true, @@ -117,7 +120,7 @@ class _AddFamilyPageState extends State { : logic.checkBtnDisable(), isDelete: state.isDetail.value, onClick: () async { - var isVip = await Storage.getBool(saveIsVip); + bool? isVip = await Storage.getBool(saveIsVip); if (isVip == true) { if (state.isDetail.value) { logic.deleteLockNoticeSetting(); @@ -148,7 +151,7 @@ class _AddFamilyPageState extends State { borderRadius: BorderRadius.circular(6.0.w), ), child: Row( - children: [ + children: [ Text( notifyTitle, style: TextStyle(color: Colors.black, fontSize: 20.sp), @@ -173,8 +176,8 @@ class _AddFamilyPageState extends State { builder: (BuildContext context) { return ShowTFView( title: - "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}", - tipTitle: "请输入".tr, + '${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}', + tipTitle: '请输入'.tr, controller: state.changeNameController, sureClick: () { //发送编辑钥匙名称请求 @@ -194,13 +197,13 @@ class _AddFamilyPageState extends State { // 接受者信息输入框 Widget getFamilyWidget(String tfStr) { - TextEditingController emailController = TextEditingController(); + final TextEditingController emailController = TextEditingController(); emailController.text = state.lockUserKeys.value.currentKeyName ?? ''; return SizedBox( height: 50.h, width: 360.w, child: Row( - children: [ + children: [ Expanded( child: TextField( controller: emailController, @@ -231,7 +234,7 @@ class _AddFamilyPageState extends State { ), style: TextStyle( fontSize: 22.sp, textBaseline: TextBaseline.alphabetic), - onChanged: (value) { + onChanged: (String value) { state.lockUserKeys.value.currentKeyName = value; state.lockUserKeys.refresh(); }, diff --git a/lib/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_logic.dart b/lib/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_logic.dart index 797daa1b..640a755b 100755 --- a/lib/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_logic.dart +++ b/lib/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_logic.dart @@ -9,12 +9,13 @@ import 'nDaysUnopened_state.dart'; class NDaysUnopenedLogic extends BaseGetXController { NDaysUnopenedState state = NDaysUnopenedState(); - void lockNoticeSettingAccountList() async { - var entity = await ApiRepository.to.updateNdaysNotCloseDoorNoticeSetting( - lockId: state.getLockId.value, - dayNotOpenDoorState: state.isUnOpenNotice.value == true ? 1 : 0, - dayNotOpenDoorValue: state.unOpenDoorTime.value, - dayNotOpenDoorNoticeWayList: [ + Future lockNoticeSettingAccountList() async { + final OpenDoorNotifyEntity entity = await ApiRepository.to + .updateNdaysNotCloseDoorNoticeSetting( + lockId: state.getLockId.value, + dayNotOpenDoorState: state.isUnOpenNotice.value == true ? 1 : 0, + dayNotOpenDoorValue: state.unOpenDoorTime.value, + dayNotOpenDoorNoticeWayList: [ {'type': 'mail', 'accounts': getEmailAndSMSAccountList(true)}, {'type': 'sms', 'accounts': getEmailAndSMSAccountList(false)} ]); @@ -26,14 +27,14 @@ class NDaysUnopenedLogic extends BaseGetXController { //获取到家人信息的请求数组 List getEmailAndSMSAccountList(bool isEmail) { - List list = []; + final List list = []; List accountList = []; isEmail ? accountList = state.emailReceiverList.value : accountList = state.phoneReceiverList.value; for (int i = 0; i < accountList.length; i++) { - MsgNoticeModeData item = accountList[i]; - Map map = {}; + final MsgNoticeModeData item = accountList[i]; + final Map map = {}; map['countryCode'] = isEmail ? 0 : item.countryCode; map['account'] = isEmail ? item.receiveEmail : item.receivePhone; list.add(map); @@ -45,9 +46,9 @@ class NDaysUnopenedLogic extends BaseGetXController { String emailListStr = ''; if (val['emailReceiverList'] != null) { state.emailReceiverList.value = val['emailReceiverList']; - List emailReceiverList = state.emailReceiverList.value; + final List emailReceiverList = state.emailReceiverList.value; for (int i = 0; i < emailReceiverList.length; i++) { - MsgNoticeModeData item = emailReceiverList[i]; + final MsgNoticeModeData item = emailReceiverList[i]; emailListStr += item.receiveEmail; // 检查是否为最后一个元素 if (i < emailReceiverList.length - 1) { @@ -63,9 +64,9 @@ class NDaysUnopenedLogic extends BaseGetXController { if (val['phoneReceiverList'] != null) { state.phoneReceiverList.value = val['phoneReceiverList']; - List phoneReceiverList = state.phoneReceiverList.value; + final List phoneReceiverList = state.phoneReceiverList.value; for (int i = 0; i < phoneReceiverList.length; i++) { - MsgNoticeModeData item = phoneReceiverList[i]; + final MsgNoticeModeData item = phoneReceiverList[i]; phoneListStr += item.receivePhone; // 检查是否为最后一个元素 if (i < phoneReceiverList.length - 1) { @@ -78,24 +79,24 @@ class NDaysUnopenedLogic extends BaseGetXController { //根据列表返回值得到邮箱、手机列表 Map> getAccountsMap() { - List mailAccounts = []; - List smsAccounts = []; + final List mailAccounts = []; + final List smsAccounts = []; if (state.msgNoticeInfo.value.dayNotOpenDoorNoticeWayList != null) { - for (NoticeWay item + for (final NoticeWay item in state.msgNoticeInfo.value.dayNotOpenDoorNoticeWayList!) { if (item.type == 'mail' && item.accounts != null) { - for (Accounts account in item.accounts!) { + for (final Accounts account in item.accounts!) { if (account.account != null) { - MsgNoticeModeData msgNoticeModeData = MsgNoticeModeData(); + final MsgNoticeModeData msgNoticeModeData = MsgNoticeModeData(); msgNoticeModeData.receiveEmail = account.account!; mailAccounts.add(msgNoticeModeData); } } } else if (item.type == 'sms' && item.accounts != null) { - for (Accounts account in item.accounts!) { + for (final Accounts account in item.accounts!) { if (account.account != null && account.countryCode != null) { - MsgNoticeModeData msgNoticeModeData = MsgNoticeModeData(); + final MsgNoticeModeData msgNoticeModeData = MsgNoticeModeData(); msgNoticeModeData.receivePhone = account.account!; msgNoticeModeData.countryCode = account.countryCode!; smsAccounts.add(msgNoticeModeData); diff --git a/lib/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_page.dart b/lib/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_page.dart index 709b027d..dbfd3b42 100755 --- a/lib/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_page.dart +++ b/lib/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_page.dart @@ -4,10 +4,11 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/appRouters.dart'; import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart'; -import 'package:star_lock/tools/showCupertinoAlertView.dart'; +import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_state.dart'; import 'package:star_lock/tools/commonItem.dart'; import 'package:star_lock/tools/pickers/pickers.dart'; import 'package:star_lock/tools/pickers/style/default_style.dart'; +import 'package:star_lock/tools/showCupertinoAlertView.dart'; import 'package:star_lock/tools/storage.dart'; import 'package:star_lock/tools/submitBtn.dart'; @@ -23,8 +24,8 @@ class NDaysUnopenedPage extends StatefulWidget { } class _NDaysUnopenedPageState extends State { - final logic = Get.put(NDaysUnopenedLogic()); - final state = Get.find().state; + final NDaysUnopenedLogic logic = Get.put(NDaysUnopenedLogic()); + final NDaysUnopenedState state = Get.find().state; @override Widget build(BuildContext context) { @@ -36,13 +37,13 @@ class _NDaysUnopenedPageState extends State { backgroundColor: AppColors.mainColor), body: ListView( padding: EdgeInsets.all(30.w), - children: [ + children: [ Row( mainAxisAlignment: MainAxisAlignment.start, - children: [ + children: [ Expanded( child: Text( - "经过以上设定的时间,锁没有被开启,系统会给指定对象发送提醒消息,该功能需要锁联网".tr, + '经过以上设定的时间,锁没有被开启,系统会给指定对象发送提醒消息,该功能需要锁联网'.tr, style: TextStyle( fontSize: 20.sp, color: AppColors.darkGrayTextColor), )), @@ -67,7 +68,7 @@ class _NDaysUnopenedPageState extends State { SubmitBtn( btnName: '保存'.tr, onClick: () async { - var isVip = await Storage.getBool(saveIsVip); + bool? isVip = await Storage.getBool(saveIsVip); if (isVip == false) { ShowCupertinoAlertView().advancedFeatureAlert(); } else { @@ -87,10 +88,10 @@ class _NDaysUnopenedPageState extends State { return Visibility( visible: state.isUnOpenNotice.value, child: Column( - children: [ + children: [ Obx(() => CommonItem( leftTitel: '门未开时间'.tr, - rightTitle: '${state.unOpenDoorTime.value}${'天'.tr}', + rightTitle: '${state.unOpenDoorTime.value}天', isHaveLine: true, isHaveRightWidget: false, isHaveDirection: true, @@ -104,8 +105,9 @@ class _NDaysUnopenedPageState extends State { GestureDetector( onTap: () { Get.toNamed(Routers.notificationModePage, - arguments: {'msgNoticeInfo': state.msgNoticeInfo.value}) - ?.then((val) { + arguments: { + 'msgNoticeInfo': state.msgNoticeInfo.value + })?.then((val) { if (val != null) { state.emailListStr.value = logic.getEmailListStr(val); state.phontListStr.value = logic.getPhoneListStr(val); @@ -116,10 +118,10 @@ class _NDaysUnopenedPageState extends State { color: Colors.white, margin: EdgeInsets.only(bottom: 10.h), child: Column( - children: [ + children: [ CommonItem( leftTitel: '提醒方式'.tr, - rightTitle: "", + rightTitle: '', isHaveLine: false, isHaveRightWidget: false, isHaveDirection: true, @@ -151,7 +153,7 @@ class _NDaysUnopenedPageState extends State { borderRadius: BorderRadius.circular(6.0.w), ), child: Row( - children: [ + children: [ Text( notifyTitle, style: TextStyle(color: Colors.black, fontSize: 20.sp), @@ -175,7 +177,7 @@ class _NDaysUnopenedPageState extends State { trackColor: CupertinoColors.systemGrey5, thumbColor: CupertinoColors.white, value: state.isUnOpenNotice.value, - onChanged: (value) { + onChanged: (bool value) { setState(() { state.isUnOpenNotice.value = value; if (!state.isUnOpenNotice.value) { @@ -187,11 +189,12 @@ class _NDaysUnopenedPageState extends State { } //底部选择pickerView - _openBottomItemSheet(BuildContext context, List dataList) { + void _openBottomItemSheet(BuildContext context, List dataList) { Pickers.showSinglePicker(context, data: dataList, - pickerStyle: DefaultPickerStyle(), onConfirm: (p, position) { - state.unOpenDoorTime.value = p; - }, onChanged: (p, position) {}); + pickerStyle: DefaultPickerStyle(), onConfirm: (p, int position) { + state.unOpenDoorTime.value = + int.parse(state.unopenDoorTimeList[position].replaceAll('天', '')); + }, onChanged: (p, int position) {}); } } diff --git a/lib/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_state.dart b/lib/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_state.dart index 3a23a139..607280bf 100755 --- a/lib/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_state.dart +++ b/lib/main/lockDetail/messageWarn/msgNotification/nDaysUnopened/nDaysUnopened_state.dart @@ -4,21 +4,21 @@ import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotific class NDaysUnopenedState { final List unopenDoorTimeList = [ - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, + '1天', + '2天', + '3天', + '4天', + '5天', + '6天', + '7天', + '8天', + '9天', + '10天', + '11天', + '12天', + '13天', + '14天', + '15天', ]; var isUnOpenNotice = false.obs; // 是否N天未开门提醒 diff --git a/lib/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_page.dart b/lib/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_page.dart index 6069a372..6bdebbf9 100755 --- a/lib/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_page.dart +++ b/lib/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_page.dart @@ -3,6 +3,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/appRouters.dart'; import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_logic.dart'; +import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRealName/value_added_services_real_name_state.dart'; import 'package:star_lock/mine/valueAddedServices/valueAddedServicesRecord/use_record_list_arg.dart'; import '../../../app_settings/app_colors.dart'; import '../../../tools/commonItem.dart'; @@ -19,8 +20,10 @@ class ValueAddedServicesRealNamePage extends StatefulWidget { class _ValueAddedServicesRealNamePageState extends State { - final logic = Get.put(ValueAddedServicesRealNameLogic()); - final state = Get.find().state; + final ValueAddedServicesRealNameLogic logic = + Get.put(ValueAddedServicesRealNameLogic()); + final ValueAddedServicesRealNameState state = + Get.find().state; @override Widget build(BuildContext context) { @@ -31,7 +34,7 @@ class _ValueAddedServicesRealNamePageState haveBack: true, backgroundColor: AppColors.mainColor), body: Column( - children: [ + children: [ Container( width: 1.sw, padding: EdgeInsets.only( @@ -42,7 +45,7 @@ class _ValueAddedServicesRealNamePageState color: AppColors.darkGrayTextColor, fontSize: 20.sp), )), middleWidget(), - Obx(() => bottomWidget()) + Obx(bottomWidget) ], ), ); @@ -55,15 +58,15 @@ class _ValueAddedServicesRealNamePageState decoration: const BoxDecoration( image: DecorationImage( image: AssetImage( - "images/mine/icon_mine_valueAddedServices_noteTop.png"), + 'images/mine/icon_mine_valueAddedServices_noteTop.png'), fit: BoxFit.cover)), - child: Column(children: [ + child: Column(children: [ Container( margin: const EdgeInsets.only(top: 15, bottom: 15, left: 30, right: 30), child: Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: [ Obx(() => Text( "${'当前剩余数量'.tr}:${state.realNameRemainCount.value}", style: TextStyle(fontSize: 24.sp), @@ -75,7 +78,7 @@ class _ValueAddedServicesRealNamePageState padding: const EdgeInsets.only(top: 10, bottom: 10), child: Row( mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ + children: [ GestureDetector( onTap: () { Get.toNamed(Routers.valueAddedServicesRecordPage, @@ -92,7 +95,7 @@ class _ValueAddedServicesRealNamePageState GestureDetector( onTap: () { Get.toNamed(Routers.advancedFeaturesWebPage, - arguments: {'isShop': false}); + arguments: {'isShop': false}); }, child: Container( width: 200.w, @@ -115,9 +118,9 @@ class _ValueAddedServicesRealNamePageState color: Colors.white, margin: EdgeInsets.all(20.h), child: Column( - children: [ + children: [ Column( - children: [ + children: [ Container( padding: EdgeInsets.only(top: 20.h, bottom: 20.h, left: 30.w), child: Text( @@ -143,10 +146,10 @@ class _ValueAddedServicesRealNamePageState Widget checkCommonItem( ValueAddedServicesRealNameLogic logic, String text, int clickIndex, {bool isHaveLine = true, bool isHaveRightWidget = true}) { - bool check = logic.state.checkIndex.value == clickIndex; + final bool check = logic.state.checkIndex.value == clickIndex; return CommonItem( leftTitel: text, - rightTitle: "", + rightTitle: '', allHeight: 60.h, isHaveLine: isHaveLine, isHaveRightWidget: isHaveRightWidget, @@ -155,7 +158,7 @@ class _ValueAddedServicesRealNamePageState logic.check(clickIndex); }, child: Row( - children: [ + children: [ Image.asset( check ? 'images/icon_round_select.png'