diff --git a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index 0ecca01f..33a21cd5 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -1,4 +1,3 @@ - import 'dart:async'; import 'package:flutter/scheduler.dart'; @@ -7,6 +6,8 @@ import 'package:get/get.dart'; import 'package:intl/intl.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart'; +import 'package:star_lock/main/lockDetail/lockSet/lockTime/getServerDatetime_entity.dart'; import 'package:star_lock/widget/permission/permission_dialog.dart'; @@ -35,7 +36,7 @@ class LockDetailLogic extends BaseGetXController { // 监听设备返回的数据 void initReplySubscription() { state.replySubscription = - EventBusManager().eventBus!.on().listen((reply) async { + EventBusManager().eventBus!.on().listen((Reply reply) async { // 开门 if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) { _replyOpenLock(reply); @@ -51,7 +52,7 @@ class LockDetailLogic extends BaseGetXController { // 开门数据解析 Future _replyOpenLock(Reply reply) async { - int status = reply.data[6]; + final int status = reply.data[6]; switch (status) { case 0x00: @@ -62,19 +63,20 @@ class LockDetailLogic extends BaseGetXController { state.iSClosedUnlockSuccessfulPopup.value = true; state.closedUnlockSuccessfulTimer?.cancel(); // 如果没有点击关闭弹窗,3秒后自动关闭 - state.closedUnlockSuccessfulTimer = Timer.periodic(3.seconds, (timer) { + state.closedUnlockSuccessfulTimer = + Timer.periodic(3.seconds, (Timer timer) { state.iSClosedUnlockSuccessfulPopup.value = false; timer.cancel(); eventBus.fire(RefreshLockDetailInfoDataEvent()); }); // 电量 - int power = reply.data[7]; + final int power = reply.data[7]; state.electricQuantity.value = power; // 备用电量 if (state.keyInfos.value.lockFeature!.isSupportBackupBattery == 1) { - int powerStandby = reply.data[9]; + final int powerStandby = reply.data[9]; state.electricQuantityStandby.value = powerStandby; } // 更新电量 @@ -85,14 +87,17 @@ class LockDetailLogic extends BaseGetXController { break; case 0x06: //无权限 - var privateKey = await Storage.getStringList(saveBluePrivateKey); - List getPrivateKeyList = changeStringListToIntList(privateKey!); + final List? privateKey = + await Storage.getStringList(saveBluePrivateKey); + final List getPrivateKeyList = + changeStringListToIntList(privateKey!); - var signKey = await Storage.getStringList(saveBlueSignKey); - List signKeyDataList = changeStringListToIntList(signKey!); + final List? signKey = + await Storage.getStringList(saveBlueSignKey); + final List signKeyDataList = changeStringListToIntList(signKey!); - var tokenData = reply.data.sublist(2, 6); - var saveStrList = changeIntListToStringList(tokenData); + final List tokenData = reply.data.sublist(2, 6); + final List saveStrList = changeIntListToStringList(tokenData); Storage.setStringList(saveBlueToken, saveStrList); IoSenderManage.senderOpenLock( @@ -110,7 +115,7 @@ class LockDetailLogic extends BaseGetXController { case 0x16: // 正在开锁中... resetOpenDoorState(); - showToast("正在开锁中...".tr, something: () { + showToast('正在开锁中...'.tr, something: () { cancelBlueConnetctToastTimer(); }); break; @@ -132,7 +137,7 @@ class LockDetailLogic extends BaseGetXController { break; case 0x0a: // 钥匙不存在 - showToast("钥匙不存在"); + showToast('钥匙不存在'); resetOpenDoorState(); cancelBlueConnetctToastTimer(); @@ -140,7 +145,7 @@ class LockDetailLogic extends BaseGetXController { break; case 0x0c: // 钥匙数量已到上限 - showToast("钥匙数量已到上限"); + showToast('钥匙数量已到上限'); resetOpenDoorState(); cancelBlueConnetctToastTimer(); @@ -148,7 +153,7 @@ class LockDetailLogic extends BaseGetXController { break; case 0x0e: // 钥匙已存在 - showToast("钥匙已存在"); + showToast('钥匙已存在'); resetOpenDoorState(); cancelBlueConnetctToastTimer(); @@ -156,7 +161,7 @@ class LockDetailLogic extends BaseGetXController { break; case 0x0f: // 用户已存在 - showToast("用户已存在"); + showToast('用户已存在'); resetOpenDoorState(); cancelBlueConnetctToastTimer(); @@ -164,7 +169,7 @@ class LockDetailLogic extends BaseGetXController { break; default: //失败 - AppLog.log("开锁失败"); + AppLog.log('开锁失败'); // state.animationController!.stop(); resetOpenDoorState(); cancelBlueConnetctToastTimer(); @@ -183,11 +188,11 @@ class LockDetailLogic extends BaseGetXController { // 根据时间查解析数据 Future _replyReferEventRecordTime(Reply reply) async { - int status = reply.data[2]; + final int status = reply.data[2]; switch (status) { case 0x00: //成功 - int dataLength = (reply.data[5] << 8) + reply.data[6]; + final int dataLength = (reply.data[5] << 8) + reply.data[6]; // AppLog.log("dataLength:$dataLength"); if (dataLength > 0) { reply.data.removeRange(0, 7); @@ -195,32 +200,32 @@ class LockDetailLogic extends BaseGetXController { if (reply.data.length < 17) { return; } - var getList = splitList(reply.data, 17); + final List> getList = splitList(reply.data, 17); // AppLog.log("getList:$getList"); - var uploadList = []; + final List uploadList = []; for (int i = 0; i < getList.length; i++) { - var indexList = getList[i]; + final List indexList = getList[i]; // AppLog.log("indexList:$indexList"); - var indexMap = {}; - indexMap["type"] = indexList[0].toString(); + final Map indexMap = {}; + indexMap['type'] = indexList[0].toString(); int operateDate = 0; if (indexList[0] == 2) { - var passwordData = reply.data.sublist(7, 17); - var password = utf8String(passwordData); - indexMap["user"] = password.toString(); + final List passwordData = reply.data.sublist(7, 17); + final String password = utf8String(passwordData); + indexMap['user'] = password.toString(); } else { - int userNo = (indexList[1] * 256) + indexList[2]; - indexMap["user"] = userNo.toString(); + final int userNo = (indexList[1] * 256) + indexList[2]; + indexMap['user'] = userNo.toString(); } - indexMap["success"] = "1"; + indexMap['success'] = '1'; - int time = ((0xff & indexList[(3)]) << 24 | + final int time = ((0xff & indexList[(3)]) << 24 | (0xff & indexList[4]) << 16 | (0xff & indexList[5]) << 8 | (0xFF & indexList[6])); operateDate = time * 1000; - indexMap["date"] = "$operateDate"; + indexMap['date'] = '$operateDate'; uploadList.add(indexMap); if (i == getList.length - 1) { @@ -256,14 +261,15 @@ class LockDetailLogic extends BaseGetXController { // BlueManage().stopScan(); BlueManage().disconnect(); }); - var privateKey = await Storage.getStringList(saveBluePrivateKey); - List getPrivateKeyList = changeStringListToIntList(privateKey!); + final List? privateKey = + await Storage.getStringList(saveBluePrivateKey); + final List getPrivateKeyList = changeStringListToIntList(privateKey!); - var signKey = await Storage.getStringList(saveBlueSignKey); - List signKeyDataList = changeStringListToIntList(signKey!); + final List? signKey = await Storage.getStringList(saveBlueSignKey); + final List signKeyDataList = changeStringListToIntList(signKey!); - var token = await Storage.getStringList(saveBlueToken); - List getTokenList = changeStringListToIntList(token!); + final List? token = await Storage.getStringList(saveBlueToken); + final List getTokenList = changeStringListToIntList(token!); BlueManage() .bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!, @@ -303,14 +309,18 @@ class LockDetailLogic extends BaseGetXController { BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async { if (connectionState == BluetoothConnectionState.connected) { - var privateKey = await Storage.getStringList(saveBluePrivateKey); - List getPrivateKeyList = changeStringListToIntList(privateKey!); + final List? privateKey = + await Storage.getStringList(saveBluePrivateKey); + final List getPrivateKeyList = + changeStringListToIntList(privateKey!); - var token = await Storage.getStringList(saveBlueToken); - List getTokenList = changeStringListToIntList(token!); + final List? token = await Storage.getStringList(saveBlueToken); + final List getTokenList = changeStringListToIntList(token!); - var publicKey = await Storage.getStringList(saveBluePublicKey); - List getPublicKeyList = changeStringListToIntList(publicKey!); + final List? publicKey = + await Storage.getStringList(saveBluePublicKey); + final List getPublicKeyList = + changeStringListToIntList(publicKey!); IoSenderManage.senderReferEventRecordTimeCommand( keyID: BlueManage().connectDeviceName, @@ -329,7 +339,8 @@ class LockDetailLogic extends BaseGetXController { // 从服务器获取锁的时间 开锁时传入 void getServerDatetime() async { - var entity = await ApiRepository.to.getServerDatetimeData(); + final GetServerDatetimeEntity entity = + await ApiRepository.to.getServerDatetimeData(); if (entity.errorCode!.codeIsSuccessful) { state.differentialTime = entity.data!.date! ~/ 1000 - DateTime.now().millisecondsSinceEpoch ~/ 1000; @@ -344,17 +355,17 @@ class LockDetailLogic extends BaseGetXController { // 获取手机联网token,根据锁设置里面获取的开锁时是否联网来判断是否调用这个接口 void getLockNetToken() async { - LockNetTokenEntity entity = await ApiRepository.to + final LockNetTokenEntity entity = await ApiRepository.to .getLockNetToken(lockId: state.keyInfos.value.lockId.toString()); if (entity.errorCode!.codeIsSuccessful) { state.lockNetToken = entity.data!.token!.toString(); - AppLog.log("从服务器获取联网token:${state.lockNetToken}"); + AppLog.log('从服务器获取联网token:${state.lockNetToken}'); openDoorAction(); } else { - showToast("网络访问失败,请检查网络是否正常".tr, something: () { + showToast('网络访问失败,请检查网络是否正常'.tr, something: () { resetOpenDoorState(); cancelBlueConnetctToastTimer(); - state.lockNetToken = "0"; + state.lockNetToken = '0'; openDoorAction(); }); } @@ -362,7 +373,7 @@ class LockDetailLogic extends BaseGetXController { //电量更新请求 Future uploadElectricQuantityRequest() async { - KeyOperationRecordEntity entity = await ApiRepository.to + final KeyOperationRecordEntity entity = await ApiRepository.to .uploadElectricQuantity( electricQuantity: state.electricQuantity.value.toString(), electricQuantityStandby: @@ -371,15 +382,15 @@ class LockDetailLogic extends BaseGetXController { isUnShowLoading: true); if (entity.errorCode!.codeIsSuccessful) { SchedulerBinding.instance.addPostFrameCallback((_) { - eventBus.fire(RefreshLockListInfoDataEvent()); + eventBus.fire(RefreshLockListInfoDataEvent(isUnShowLoading: true)); }); } } // 查询锁记录最后时间 void getLockRecordLastUploadDataTime() async { - LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to - .getLockRecordLastUploadDataTime( + final LockOperatingRecordGetLastRecordTimeEntity entity = + await ApiRepository.to.getLockRecordLastUploadDataTime( lockId: state.keyInfos.value.lockId.toString()); if (entity.errorCode!.codeIsSuccessful) { state.operateDate = entity.data!.operateDate! ~/ 1000; @@ -388,14 +399,14 @@ class LockDetailLogic extends BaseGetXController { } // 操作记录上传 - void lockRecordUploadData(List list) async { - KeyOperationRecordEntity entity = await ApiRepository.to + Future lockRecordUploadData(List list) async { + final KeyOperationRecordEntity entity = await ApiRepository.to .lockRecordUploadData( lockId: state.keyInfos.value.lockId.toString(), records: list); if (entity.errorCode!.codeIsSuccessful) { // mockNetworkDataRequest(); AppLog.log( - "state.keyInfos.value.keyType:${state.keyInfos.value.keyType}"); + 'state.keyInfos.value.keyType:${state.keyInfos.value.keyType}'); if (state.keyInfos.value.keyType == XSConstantMacro.keyTypeOnce) { // 单次删除 deletKeyData(); @@ -405,10 +416,11 @@ class LockDetailLogic extends BaseGetXController { // 普通用户或者授权管理员删除钥匙 void deletKeyData() async { - var entity = await ApiRepository.to.deleteElectronicKey( - keyId: state.keyInfos.value.keyId.toString(), includeUnderlings: 0); + final ElectronicKeyListEntity entity = await ApiRepository.to + .deleteElectronicKey( + keyId: state.keyInfos.value.keyId.toString(), includeUnderlings: 0); if (entity.errorCode!.codeIsSuccessful) { - BlueManage().connectDeviceMacAddress = ""; + BlueManage().connectDeviceMacAddress = ''; SchedulerBinding.instance.addPostFrameCallback((_) { eventBus.fire(RefreshLockListInfoDataEvent()); }); @@ -422,7 +434,7 @@ class LockDetailLogic extends BaseGetXController { state.lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent = eventBus .on() - .listen((event) { + .listen((LockSetChangeSetRefreshLockDetailWithType event) { if (event.type == 0) { // 0考勤 state.isAttendance.value = int.parse(event.setResult); @@ -433,7 +445,7 @@ class LockDetailLogic extends BaseGetXController { state.isOpenLockNeedOnline.value = int.parse(event.setResult); state.keyInfos.value.lockSetting!.appUnlockOnline = int.parse(event.setResult); - state.lockNetToken = ""; // 改变开锁时是否联网状态的时候清空token + state.lockNetToken = ''; // 改变开锁时是否联网状态的时候清空token } else if (event.type == 2) { // 2 常开模式 state.isOpenPassageMode.value = int.parse(event.setResult); @@ -458,7 +470,7 @@ class LockDetailLogic extends BaseGetXController { } String getKeyStatusTextAndShow() { - String text = ""; + String text = ''; if (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitIneffective || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen || @@ -469,7 +481,7 @@ class LockDetailLogic extends BaseGetXController { "${"你的钥匙".tr}${XSConstantMacro.getKeyStatusStr(state.keyInfos.value.keyStatus!)}"; } else { text = state.isOpenPassageMode.value == 1 - ? "常开模式启动!长按闭锁".tr + ? '常开模式启动!长按闭锁'.tr : TranslationLoader.lanKeys!.clickUnlockAndHoldDownClose!.tr; } return text; @@ -477,9 +489,9 @@ class LockDetailLogic extends BaseGetXController { String getCurrentFormattedTime() { // 获取当前时间 - DateTime now = DateTime.now(); + final DateTime now = DateTime.now(); // 格式化日期和时间 - String formattedTime = DateFormat('MM/dd HH:mm').format(now); + final String formattedTime = DateFormat('MM/dd HH:mm').format(now); return formattedTime; } diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 451f629f..f179465c 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -8,6 +8,7 @@ import 'package:intl/intl.dart'; import 'package:star_lock/app_settings/app_colors.dart'; import 'package:star_lock/flavors.dart'; import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_list_page.dart'; +import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_state.dart'; import 'package:star_lock/tools/aliyunRealNameAuth/aliyunRealNameAuthHandle.dart'; import 'package:star_lock/tools/showCupertinoAlertView.dart'; import 'package:star_lock/tools/showTipView.dart'; @@ -44,8 +45,8 @@ class LockDetailPage extends StatefulWidget { class _LockDetailPageState extends State with TickerProviderStateMixin, RouteAware { // with RouteAware - final logic = Get.put(LockDetailLogic()); - final state = Get.find().state; + final LockDetailLogic logic = Get.put(LockDetailLogic()); + final LockDetailState state = Get.find().state; @override void initState() { @@ -75,8 +76,9 @@ class _LockDetailPageState extends State void _initRefreshLockDetailInfoDataEventAction() { // 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus - _lockRefreshLockDetailInfoDataEvent = - eventBus.on().listen((event) { + _lockRefreshLockDetailInfoDataEvent = eventBus + .on() + .listen((RefreshLockDetailInfoDataEvent event) { setState(() {}); }); } @@ -114,26 +116,28 @@ class _LockDetailPageState extends State BlueManage().connectDeviceName = state.keyInfos.value.bluetooth!.bluetoothDeviceName!; - List publicKeyData = + final List publicKeyData = state.keyInfos.value.bluetooth!.publicKey!.cast(); - var saveStrList = changeIntListToStringList(publicKeyData); + final List saveStrList = changeIntListToStringList(publicKeyData); Storage.setStringList(saveBluePublicKey, saveStrList); // 私钥 - List privateKeyData = + final List privateKeyData = state.keyInfos.value.bluetooth!.privateKey!.cast(); - var savePrivateKeyList = changeIntListToStringList(privateKeyData); + final List savePrivateKeyList = + changeIntListToStringList(privateKeyData); Storage.setStringList(saveBluePrivateKey, savePrivateKeyList); // signKey - List signKeyData = + final List signKeyData = state.keyInfos.value.bluetooth!.signKey!.cast(); - var saveSignKeyList = changeIntListToStringList(signKeyData); + final List saveSignKeyList = changeIntListToStringList(signKeyData); Storage.setStringList(saveBlueSignKey, saveSignKeyList); - bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken); + final bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken); if (!ifHaveKey) { - var saveTokenList = changeIntListToStringList([0, 0, 0, 0]); + final List saveTokenList = + changeIntListToStringList([0, 0, 0, 0]); Storage.setStringList(saveBlueToken, saveTokenList); } } @@ -141,7 +145,7 @@ class _LockDetailPageState extends State @override Widget build(BuildContext context) { loadData(); - return F.sw(defaultCall: () => skWidget(), xhjCall: () => xhjWidget()); + return F.sw(defaultCall: skWidget, xhjCall: xhjWidget); } //鑫泓佳布局 @@ -150,9 +154,9 @@ class _LockDetailPageState extends State backgroundColor: Colors.white, body: Obx(() { return Stack( - children: [ + children: [ Column( - children: [ + children: [ SizedBox( height: 35.h, ), @@ -193,7 +197,7 @@ class _LockDetailPageState extends State decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(16.r), - boxShadow: [ + boxShadow: [ BoxShadow( color: Colors.black.withOpacity(0.15), offset: const Offset(0, 0), @@ -202,7 +206,7 @@ class _LockDetailPageState extends State ), ]), child: Row( - children: [ + children: [ Image.asset( img, width: 32.r, @@ -236,7 +240,7 @@ class _LockDetailPageState extends State fit: BoxFit.cover, ), borderRadius: BorderRadius.circular(20.r), - boxShadow: [ + boxShadow: [ BoxShadow( color: Colors.black.withOpacity(0.15), offset: const Offset(0, 0), @@ -247,19 +251,15 @@ class _LockDetailPageState extends State ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ const Spacer(), GestureDetector( onTap: state.openDoorBtnisUneable.value == true - ? () { - isNeedRealNameAuthThenOpenLock(); - } + ? isNeedRealNameAuthThenOpenLock : null, onLongPressStart: state.openDoorBtnisUneable.value == true - ? (details) { - setState(() { - startUnLock(); - }); + ? (LongPressStartDetails details) { + setState(startUnLock); } : null, child: Container( @@ -268,7 +268,7 @@ class _LockDetailPageState extends State decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(100.w), - boxShadow: [ + boxShadow: [ BoxShadow( color: Colors.black.withOpacity(0.3), offset: const Offset(0, 0), @@ -279,42 +279,44 @@ class _LockDetailPageState extends State margin: EdgeInsets.only(left: 35.w, bottom: 15.h), child: Stack( alignment: AlignmentDirectional.center, - children: [ - state.openDoorBtnisUneable.value == false - ? Icon( - Icons.bluetooth_searching, - size: 48.r, - color: AppColors.mainColor, - ) - : Image.asset( - state.isOpenPassageMode.value == 1 - ? 'images/icon_lock_err.png' - : 'images/icon_lock_fill.png', - width: 38.r, - height: 38.r, - color: AppColors.mainColor, - ), - state.openDoorBtnisUneable.value == false - ? Positioned( - child: Icon( - Icons.bluetooth_searching, - size: 96.r, - ), - ) - : state.openLockBtnState.value == 1 - ? xhjBuildRotationTransition( - width: 88.r, - height: 88.r, - ) - : Positioned( - child: Image.asset( - 'images/icon_circle_dotted.png', - width: 88.r, - height: 88.r, - color: state.isOpenPassageMode.value == 1 - ? Colors.red - : AppColors.mainColor, - )), + children: [ + if (state.openDoorBtnisUneable.value == false) + Icon( + Icons.bluetooth_searching, + size: 48.r, + color: AppColors.mainColor, + ) + else + Image.asset( + state.isOpenPassageMode.value == 1 + ? 'images/icon_lock_err.png' + : 'images/icon_lock_fill.png', + width: 38.r, + height: 38.r, + color: AppColors.mainColor, + ), + if (state.openDoorBtnisUneable.value == false) + Positioned( + child: Icon( + Icons.bluetooth_searching, + size: 96.r, + ), + ) + else + state.openLockBtnState.value == 1 + ? xhjBuildRotationTransition( + width: 88.r, + height: 88.r, + ) + : Positioned( + child: Image.asset( + 'images/icon_circle_dotted.png', + width: 88.r, + height: 88.r, + color: state.isOpenPassageMode.value == 1 + ? Colors.red + : AppColors.mainColor, + )), ], ), ), @@ -323,10 +325,10 @@ class _LockDetailPageState extends State padding: EdgeInsets.only(left: 15.w, right: 00.w, bottom: 15.h), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ Text( TranslationLoader .lanKeys!.clickUnlockAndHoldDownClose!.tr, @@ -341,16 +343,16 @@ class _LockDetailPageState extends State Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ Row( mainAxisAlignment: MainAxisAlignment.end, - children: [ + children: [ Image.asset( showElectricIcon(state.electricQuantity.value), width: 30.w, height: 24.w), SizedBox(width: 2.w), - Text("${state.electricQuantity.value}%", + Text('${state.electricQuantity.value}%', style: TextStyle( fontSize: 18.sp, color: AppColors.darkGrayTextColor)), @@ -368,13 +370,13 @@ class _LockDetailPageState extends State ), Row( mainAxisAlignment: MainAxisAlignment.end, - children: [ + children: [ Image.asset( showElectricIcon(state.electricQuantity.value), width: 30.w, height: 24.w), SizedBox(width: 2.w), - Text("--%", + Text('--%', style: TextStyle( fontSize: 18.sp, color: AppColors.darkGrayTextColor)), @@ -400,32 +402,30 @@ class _LockDetailPageState extends State //斯凯布局 Widget skWidget() { return ListView( - children: [ + children: [ Visibility( visible: - ((state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || - state.keyInfos.value.keyType == - XSConstantMacro.keyTypeLoop) && // 限时、循环 - (DateTool().compareTimeGetDaysFromNow( - state.keyInfos.value.endDate!) <= - 15 && - DateTool().compareTimeGetDaysFromNow( - state.keyInfos.value.endDate!) >= - 0) && // 0到30天 - (state.keyInfos.value.keyStatus == - XSConstantMacro.keyStatusNormalUse || - state.keyInfos.value.keyStatus == - XSConstantMacro.keyStatusWaitReceive) // 正常使用、待接收 - ) - ? true - : false, + (state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || + state.keyInfos.value.keyType == + XSConstantMacro.keyTypeLoop) && // 限时、循环 + (DateTool().compareTimeGetDaysFromNow( + state.keyInfos.value.endDate!) <= + 15 && + DateTool().compareTimeGetDaysFromNow( + state.keyInfos.value.endDate!) >= + 0) && // 0到30天 + (state.keyInfos.value.keyStatus == + XSConstantMacro.keyStatusNormalUse || + state.keyInfos.value.keyStatus == + XSConstantMacro.keyStatusWaitReceive) // 正常使用、待接收 + , child: Container( // height: 30.h, color: const Color(0xFFFBEFD4), padding: EdgeInsets.only(top: 8.h, bottom: 8.h), child: Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: [ Text( "${"钥匙将在".tr}${DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!)}${"天后失效".tr}", style: TextStyle( @@ -434,26 +434,26 @@ class _LockDetailPageState extends State ), ), ), - Stack(children: [ + Stack(children: [ Container( width: 1.sw, height: 1.sh - ScreenUtil().statusBarHeight, color: Colors.white, child: Column( - children: [ + children: [ topWidget(), SizedBox( height: 10.h, ), - Obx(() => buildPageIndicator()), + Obx(buildPageIndicator), Expanded( child: Container( margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 30.h), child: PageView( scrollDirection: Axis.horizontal, controller: state.pageController, - children: [ - Obx(() => bottomWidget()), + children: [ + Obx(bottomWidget), attachmentWidget(), ], ), @@ -476,7 +476,7 @@ class _LockDetailPageState extends State Widget topWidget() { return Column( - children: [ + children: [ F.sw( defaultCall: () => SizedBox(height: 50.h), xhjCall: () => Padding( @@ -490,7 +490,7 @@ class _LockDetailPageState extends State ), ), Stack( - children: [ + children: [ Center( child: Text( state.lockAlias.value, @@ -504,7 +504,7 @@ class _LockDetailPageState extends State Positioned( child: Column( mainAxisSize: MainAxisSize.min, - children: [ + children: [ GestureDetector( onTap: () { ShowTipView().showSureAlertDialog( @@ -512,7 +512,7 @@ class _LockDetailPageState extends State }, child: Row( mainAxisAlignment: MainAxisAlignment.end, - children: [ + children: [ FlavorsImg( child: Image.asset( showElectricIcon(state.electricQuantity.value), @@ -520,7 +520,7 @@ class _LockDetailPageState extends State height: 24.w), ), SizedBox(width: 2.w), - Text("${state.electricQuantity.value}%", + Text('${state.electricQuantity.value}%', style: TextStyle( fontSize: 18.sp, color: AppColors.darkGrayTextColor)), @@ -542,7 +542,7 @@ class _LockDetailPageState extends State 1, child: Row( mainAxisAlignment: MainAxisAlignment.end, - children: [ + children: [ FlavorsImg( child: Image.asset( showElectricIcon( @@ -551,7 +551,7 @@ class _LockDetailPageState extends State height: 24.w), ), SizedBox(width: 2.w), - Text("${state.electricQuantityStandby.value}%", + Text('${state.electricQuantityStandby.value}%', style: TextStyle( fontSize: 18.sp, color: AppColors.darkGrayTextColor)), @@ -580,23 +580,19 @@ class _LockDetailPageState extends State color: Colors.white, height: 330.w, child: Stack( - children: [ + children: [ Center( child: GestureDetector( onTap: state.openDoorBtnisUneable.value == true - ? () { - isNeedRealNameAuthThenOpenLock(); - } + ? isNeedRealNameAuthThenOpenLock : null, onLongPressStart: state.openDoorBtnisUneable.value == true - ? (details) { - setState(() { - startUnLock(); - }); + ? (LongPressStartDetails details) { + setState(startUnLock); } : null, child: Stack( - children: [ + children: [ FlavorsImg( child: Image.asset( state.openDoorBtnisUneable.value == false @@ -609,31 +605,32 @@ class _LockDetailPageState extends State // color: AppColors.primaryTopColor, ), ), - state.openDoorBtnisUneable.value == false - ? Positioned( - child: FlavorsImg( + if (state.openDoorBtnisUneable.value == false) + Positioned( + child: FlavorsImg( + child: Image.asset( + 'images/main/icon_main_openLockBtn_grey.png', + width: 330.w, + height: 330.w, + ), + ), + ) + else + state.openLockBtnState.value == 1 + ? buildRotationTransition( + width: 330.w, + height: 330.w, + ) + : Positioned( + child: FlavorsImg( child: Image.asset( - 'images/main/icon_main_openLockBtn_grey.png', + state.isOpenPassageMode.value == 1 + ? 'images/main/icon_main_normallyOpenMode_circle.png' + : 'images/main/icon_main_openLockBtn_circle.png', width: 330.w, height: 330.w, ), - ), - ) - : state.openLockBtnState.value == 1 - ? buildRotationTransition( - width: 330.w, - height: 330.w, - ) - : Positioned( - child: FlavorsImg( - child: Image.asset( - state.isOpenPassageMode.value == 1 - ? 'images/main/icon_main_normallyOpenMode_circle.png' - : 'images/main/icon_main_openLockBtn_circle.png', - width: 330.w, - height: 330.w, - ), - )), + )), ], ), )), @@ -641,9 +638,8 @@ class _LockDetailPageState extends State right: 90.w, bottom: 1, child: Obx(() => Visibility( - visible: state.keyInfos.value.lockSetting!.remoteUnlock == 1 - ? true - : false, + visible: + state.keyInfos.value.lockSetting!.remoteUnlock == 1, child: GestureDetector( onTap: () { ShowCupertinoAlertView().isToRemoteUnLockAlert( @@ -672,7 +668,7 @@ class _LockDetailPageState extends State ), Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: [ Text( logic.getKeyStatusTextAndShow(), style: TextStyle( @@ -685,9 +681,7 @@ class _LockDetailPageState extends State SizedBox( height: 30.h, ), - F.sw( - defaultCall: () => adminInfoView(), - xhjCall: () => const SizedBox()), + F.sw(defaultCall: adminInfoView, xhjCall: () => const SizedBox()), SizedBox( height: 20.h, ), @@ -707,7 +701,7 @@ class _LockDetailPageState extends State mainAxisAlignment: center ? MainAxisAlignment.center : MainAxisAlignment.start, mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min, - children: [ + children: [ Image.asset( 'images/icon_electronicKey_admin.png', width: 24.w, @@ -742,7 +736,7 @@ class _LockDetailPageState extends State ? AppColors.mainColor : AppColors.btnDisableColor), ), - if (add) ...[ + if (add) ...[ const Spacer(), GestureDetector( onTap: () { @@ -752,7 +746,7 @@ class _LockDetailPageState extends State padding: const EdgeInsets.all(8.0), child: Row( mainAxisSize: MainAxisSize.min, - children: [ + children: [ FlavorsImg( child: Image.asset( 'images/mine/icon_mine_main_addLock.png', @@ -823,7 +817,7 @@ class _LockDetailPageState extends State Widget buildPageIndicator() { return Row( mainAxisAlignment: MainAxisAlignment.center, - children: List.generate(2, (index) { + children: List.generate(2, (int index) { return Container( width: 10.0.w, height: 10.0.w, @@ -855,7 +849,7 @@ class _LockDetailPageState extends State // 配件配置 List getAttachmentWidget() { - var showWidgetArr = []; + final List showWidgetArr = []; // 无线键盘 // if (state.isAttendance.value == 1) { // showWidgetArr.add(bottomItem( @@ -911,7 +905,7 @@ class _LockDetailPageState extends State // 普通用户 List getNormalWidget() { - List showWidgetArr = []; + final List showWidgetArr = []; // 考勤 if (state.isAttendance.value == 1) { showWidgetArr.add(bottomItem( @@ -928,15 +922,17 @@ class _LockDetailPageState extends State TranslationLoader.lanKeys!.operatingRecord!.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.doorLockLogPage, - arguments: {"keyInfo": state.keyInfos.value}); + arguments: { + 'keyInfo': state.keyInfos.value + }); })); // 设置 showWidgetArr.add(bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, true, () { - Get.toNamed(Routers.lockSetPage, arguments: { - "lockId": state.keyInfos.value.lockId, - "isOnlyOneData": state.isOnlyOneData + Get.toNamed(Routers.lockSetPage, arguments: { + 'lockId': state.keyInfos.value.lockId, + 'isOnlyOneData': state.isOnlyOneData }); })); @@ -945,7 +941,7 @@ class _LockDetailPageState extends State // 授权管理员、超级管理员字段 List getAllWidget() { - var showWidgetArr = []; + final List showWidgetArr = []; // 考勤 if (state.isAttendance.value == 1) { showWidgetArr.add(bottomItem( @@ -971,7 +967,9 @@ class _LockDetailPageState extends State TranslationLoader.lanKeys!.password!.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.passwordKeyListPage, - arguments: {"keyInfo": state.keyInfos.value}); + arguments: { + 'keyInfo': state.keyInfos.value + }); })); // ic卡 @@ -980,8 +978,8 @@ class _LockDetailPageState extends State 'images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, state.bottomBtnisEable.value, () { - Get.toNamed(Routers.cardListPage, arguments: { - "lockId": state.keyInfos.value.lockId, + Get.toNamed(Routers.cardListPage, arguments: { + 'lockId': state.keyInfos.value.lockId, }); })); } @@ -992,8 +990,8 @@ class _LockDetailPageState extends State 'images/main/icon_main_fingerprint.png', TranslationLoader.lanKeys!.fingerprint!.tr, state.bottomBtnisEable.value, () { - Get.toNamed(Routers.fingerprintListPage, arguments: { - "lockId": state.keyInfos.value.lockId, + Get.toNamed(Routers.fingerprintListPage, arguments: { + 'lockId': state.keyInfos.value.lockId, }); })); } @@ -1015,8 +1013,8 @@ class _LockDetailPageState extends State 'images/main/icon_face.png', TranslationLoader.lanKeys!.humanFace!.tr, state.bottomBtnisEable.value, () { - Get.toNamed(Routers.faceListPage, arguments: { - "lockId": state.keyInfos.value.lockId, + Get.toNamed(Routers.faceListPage, arguments: { + 'lockId': state.keyInfos.value.lockId, }); }), ); @@ -1027,8 +1025,8 @@ class _LockDetailPageState extends State bottomItem( 'images/main/icon_iris.png', '虹膜'.tr, state.bottomBtnisEable.value, () { - Get.toNamed(Routers.irisListPage, arguments: { - "lockId": state.keyInfos.value.lockId, + Get.toNamed(Routers.irisListPage, arguments: { + 'lockId': state.keyInfos.value.lockId, }); }), ); @@ -1039,8 +1037,8 @@ class _LockDetailPageState extends State bottomItem( 'images/main/icon_palm.png', '手掌'.tr, state.bottomBtnisEable.value, () { - Get.toNamed(Routers.palmListPage, arguments: { - "lockId": state.keyInfos.value.lockId, + Get.toNamed(Routers.palmListPage, arguments: { + 'lockId': state.keyInfos.value.lockId, }); }), ); @@ -1053,9 +1051,9 @@ class _LockDetailPageState extends State 'images/main/icon_catEyes.png', TranslationLoader.lanKeys!.monitoring!.tr, state.bottomBtnisEable.value, () { - Get.toNamed(Routers.realTimePicturePage, arguments: { - "lockName": state.keyInfos.value.lockName, - "isMonitoring": true + Get.toNamed(Routers.realTimePicturePage, arguments: { + 'lockName': state.keyInfos.value.lockName, + 'isMonitoring': true }); }), ); @@ -1068,11 +1066,13 @@ class _LockDetailPageState extends State TranslationLoader.lanKeys!.authorizedAdmin!.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.authorizedAdminListPage, - arguments: {"keyInfo": state.keyInfos.value}); + arguments: { + 'keyInfo': state.keyInfos.value + }); })); } - var endWiddget = []; + final List endWiddget = []; endWiddget.add( // 操作记录 bottomItem( @@ -1082,7 +1082,9 @@ class _LockDetailPageState extends State // Get.toNamed(Routers.lockOperatingRecordPage, // arguments: {"keyInfo": state.keyInfos.value}); Get.toNamed(Routers.doorLockLogPage, - arguments: {"keyInfo": state.keyInfos.value}); + arguments: { + 'keyInfo': state.keyInfos.value + }); }), ); @@ -1092,8 +1094,8 @@ class _LockDetailPageState extends State 'images/main/icon_lockDetail_videoLog.png', TranslationLoader.lanKeys!.videoLog!.tr, state.bottomBtnisEable.value, () { - Get.toNamed(Routers.videoLogPage, arguments: { - "lockId": state.keyInfos.value.lockId, + Get.toNamed(Routers.videoLogPage, arguments: { + 'lockId': state.keyInfos.value.lockId, }); })); } @@ -1103,8 +1105,8 @@ class _LockDetailPageState extends State 'images/main/icon_lockDetail_messageReminding.png', TranslationLoader.lanKeys!.messageReminding!.tr, state.bottomBtnisEable.value, () { - Get.toNamed(Routers.msgNotificationPage, arguments: { - "lockId": state.keyInfos.value.lockId, + Get.toNamed(Routers.msgNotificationPage, arguments: { + 'lockId': state.keyInfos.value.lockId, }); }), ); @@ -1114,9 +1116,9 @@ class _LockDetailPageState extends State bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, true, () { // logic.clickItemBtnAction(10); - Get.toNamed(Routers.lockSetPage, arguments: { - "lockId": state.keyInfos.value.lockId, - "isOnlyOneData": state.isOnlyOneData, + Get.toNamed(Routers.lockSetPage, arguments: { + 'lockId': state.keyInfos.value.lockId, + 'isOnlyOneData': state.isOnlyOneData, }); }), ); @@ -1126,12 +1128,12 @@ class _LockDetailPageState extends State Widget bottomItem( String iconUrl, String name, bool bottomBtnisEable, Function() onClick) { - Widget child = F.sw( + final Widget child = F.sw( defaultCall: () => Container( color: Colors.white, child: Column( crossAxisAlignment: CrossAxisAlignment.center, - children: [ + children: [ SizedBox( width: 42.w, height: 42.h, @@ -1164,7 +1166,7 @@ class _LockDetailPageState extends State padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.w), child: Row( crossAxisAlignment: CrossAxisAlignment.center, - children: [ + children: [ SizedBox( width: 42.w, height: 42.h, @@ -1195,19 +1197,19 @@ class _LockDetailPageState extends State onTap: bottomBtnisEable ? onClick : () { - logic.showToast("请在锁旁边完成第一次开锁".tr); + logic.showToast('请在锁旁边完成第一次开锁'.tr); }, child: child, ); } - listeningAnimations() async { - await Future.delayed(Duration.zero, () { + Future listeningAnimations() async { + await Future.delayed(Duration.zero, () { state.animationController = AnimationController( duration: const Duration(seconds: 1), vsync: this); state.animationController!.repeat(); //动画开始、结束、向前移动或向后移动时会调用StatusListener - state.animationController!.addStatusListener((status) { + state.animationController!.addStatusListener((AnimationStatus status) { if (status == AnimationStatus.completed) { state.animationController!.reset(); state.animationController!.forward(); @@ -1237,7 +1239,7 @@ class _LockDetailPageState extends State Widget _unlockSuccessWidget() { return Center( child: Stack( - children: [ + children: [ Image.asset( state.iSOpenLock.value == true ? 'images/main/unlocked_bg.png' @@ -1250,7 +1252,7 @@ class _LockDetailPageState extends State left: 55.w, child: Column( mainAxisSize: MainAxisSize.min, - children: [ + children: [ Text( state.keyInfos.value.lockAlias!, style: TextStyle( @@ -1289,9 +1291,9 @@ class _LockDetailPageState extends State String getCurrentFormattedTime() { // 获取当前时间 - DateTime now = DateTime.now(); + final DateTime now = DateTime.now(); // 格式化日期和时间 - String formattedTime = DateFormat('MM/dd HH:mm').format(now); + final String formattedTime = DateFormat('MM/dd HH:mm').format(now); return formattedTime; } @@ -1303,24 +1305,20 @@ class _LockDetailPageState extends State DateTool().compareTimeIsOvertime(state.nextAuthTime.value) == true) { AliyunRealNameAuthProvider( getLockInfo: state.keyInfos.value, - onCertifyResultWithTime: ((bool isSuccess, int getNextAuthTime) { + onCertifyResultWithTime: (bool isSuccess, int getNextAuthTime) { state.nextAuthTime.value = getNextAuthTime; if (isSuccess) { // 认证成功,去开锁 - setState(() { - startOpenLock(); - }); + setState(startOpenLock); } - })).initAliyunRealNameAuth(); + }).initAliyunRealNameAuth(); } else { //无需认证,直接开锁 - setState(() { - startOpenLock(); - }); + setState(startOpenLock); } } - startOpenLock() { + void startOpenLock() { if (state.openLockBtnState.value == 1) { return; } @@ -1329,21 +1327,21 @@ class _LockDetailPageState extends State state.openLockBtnState.value = 1; state.animationController!.forward(); - AppLog.log("点击开锁"); + AppLog.log('点击开锁'); if (state.isOpenLockNeedOnline.value == 0) { // 不需要联网 state.openDoorModel = 0; - AppLog.log("点击开锁 state.openDoorModel = 0 不需要联网"); + AppLog.log('点击开锁 state.openDoorModel = 0 不需要联网'); logic.openDoorAction(); } else { // 需要联网 state.openDoorModel = 2; - AppLog.log("点击开锁 state.openDoorModel = 2 需要联网"); + AppLog.log('点击开锁 state.openDoorModel = 2 需要联网'); logic.getLockNetToken(); } } - startUnLock() { + void startUnLock() { if (state.openLockBtnState.value == 1) { return; } @@ -1352,16 +1350,16 @@ class _LockDetailPageState extends State state.openLockBtnState.value = 1; state.animationController!.forward(); - EasyLoading.showToast("正在尝试闭锁……".tr, duration: 2000.milliseconds); - AppLog.log("长按闭锁"); + EasyLoading.showToast('正在尝试闭锁……'.tr, duration: 2000.milliseconds); + AppLog.log('长按闭锁'); if (state.isOpenLockNeedOnline.value == 0) { // 不需要联网 - AppLog.log("长按闭锁 state.openDoorModel = 32 不需要联网"); + AppLog.log('长按闭锁 state.openDoorModel = 32 不需要联网'); state.openDoorModel = 32; logic.openDoorAction(); } else { // 需要联网 - AppLog.log("长按闭锁 state.openDoorModel = 34 需要联网"); + AppLog.log('长按闭锁 state.openDoorModel = 34 需要联网'); state.openDoorModel = 34; logic.getLockNetToken(); } diff --git a/lib/main/lockMian/lockMain/lockMain_logic.dart b/lib/main/lockMian/lockMain/lockMain_logic.dart index f86bd6fc..af2032bf 100755 --- a/lib/main/lockMian/lockMain/lockMain_logic.dart +++ b/lib/main/lockMian/lockMain/lockMain_logic.dart @@ -15,10 +15,11 @@ import 'lockMain_state.dart'; class LockMainLogic extends BaseGetXController { final LockMainState state = LockMainState(); - Future getStarLockInfo() async { + Future getStarLockInfo({bool isUnShowLoading = false}) async { LockListInfoEntity entity = await ApiRepository.to.getStarLockListInfo( pageNo: pageNo, pageSize: 50, + isUnShowLoading: isUnShowLoading, ); if (entity.errorCode!.codeIsSuccessful) { loadMainDataLogic(entity.data!); diff --git a/lib/main/lockMian/lockMain/lockMain_page.dart b/lib/main/lockMian/lockMain/lockMain_page.dart index 034df4a8..d8d7b3cb 100755 --- a/lib/main/lockMian/lockMain/lockMain_page.dart +++ b/lib/main/lockMian/lockMain/lockMain_page.dart @@ -37,14 +37,15 @@ class _StarLockMainPageState extends State with BaseWidget { final logic = Get.put(LockMainLogic()); final state = Get.find().state; - Future getHttpData({bool clearScanDevices = false}) async { + Future getHttpData( + {bool clearScanDevices = false, bool isUnShowLoading = false}) async { LockListInfoGroupEntity? lockListInfoGroupEntity = await Storage.getLockMainListData(); if (lockListInfoGroupEntity != null) { var localLockListInfoGroupEntity = lockListInfoGroupEntity; await logic.loadMainDataLogic(localLockListInfoGroupEntity); } - await logic.getStarLockInfo(); + await logic.getStarLockInfo(isUnShowLoading: isUnShowLoading); await Future.delayed(const Duration(milliseconds: 200)); if (clearScanDevices) { BlueManage().scanDevices.clear(); @@ -237,7 +238,9 @@ class _StarLockMainPageState extends State with BaseWidget { void _initLoadDataAction() { _teamEvent = eventBus.on().listen((event) { logic.pageNo = 1; - getHttpData(clearScanDevices: event.clearScanDevices); + getHttpData( + clearScanDevices: event.clearScanDevices, + isUnShowLoading: event.isUnShowLoading); }); } diff --git a/lib/network/api_provider.dart b/lib/network/api_provider.dart index c2182fa6..bfcbb04f 100755 --- a/lib/network/api_provider.dart +++ b/lib/network/api_provider.dart @@ -171,7 +171,7 @@ class ApiProvider extends BaseProvider { 'idCardNumber': idCardNumber })); - Future uploadElectricQuantity( + Future> uploadElectricQuantity( String electricQuantity, String electricQuantityStandby, String lockId, @@ -374,12 +374,12 @@ class ApiProvider extends BaseProvider { })); // 获取锁信息列表 - Future getStarLockListInfo(int pageNo, int pageSize) => post( + Future getStarLockListInfo(int pageNo, int pageSize,{bool isUnShowLoading = true}) => post( getStarLockInfoURL.toUrl, jsonEncode({ "pageNo": pageNo, 'pageSize': pageSize, - })); + }),isUnShowLoading: isUnShowLoading); // 获取所有锁设置信息 Future getLockSettingInfoData(String lockId) => post( diff --git a/lib/network/api_provider_base.dart b/lib/network/api_provider_base.dart index aebb0e7a..5698314a 100755 --- a/lib/network/api_provider_base.dart +++ b/lib/network/api_provider_base.dart @@ -37,7 +37,6 @@ class BaseProvider extends GetConnect with Api { }) async { AppLog.log("post: url:$url body:$body"); if (isUnShowLoading == false){ - // AppLog.log("post: url:$url show loading"); EasyLoading.show(); } if (isUserBaseUrl == false) { diff --git a/lib/network/api_repository.dart b/lib/network/api_repository.dart index 9288b3c8..bcaba46b 100755 --- a/lib/network/api_repository.dart +++ b/lib/network/api_repository.dart @@ -421,8 +421,8 @@ class ApiRepository { // 获取锁信息列表 Future getStarLockListInfo( - {required int pageNo, required int pageSize}) async { - final res = await apiProvider.getStarLockListInfo(pageNo, pageSize); + {required int pageNo, required int pageSize,required bool isUnShowLoading}) async { + final res = await apiProvider.getStarLockListInfo(pageNo, pageSize,isUnShowLoading:isUnShowLoading); return LockListInfoEntity.fromJson(res.body); } diff --git a/lib/tools/eventBusEventManage.dart b/lib/tools/eventBusEventManage.dart index 99ed2e1a..f6fca01a 100755 --- a/lib/tools/eventBusEventManage.dart +++ b/lib/tools/eventBusEventManage.dart @@ -9,8 +9,10 @@ EventBus eventBus = EventBus(); class RefreshLockListInfoDataEvent { //是否清除蓝牙设备列表缓存 bool clearScanDevices; + bool isUnShowLoading; - RefreshLockListInfoDataEvent({this.clearScanDevices = false}); + RefreshLockListInfoDataEvent( + {this.clearScanDevices = false, this.isUnShowLoading = false}); } /// 蓝牙添加用户成功