From debb1bfd4087cad02e21dbfee45660f0338ed01b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Wed, 4 Dec 2024 15:21:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=90=88=E5=B9=B6bugly=E5=88=86?= =?UTF-8?q?=E6=94=AF=E5=88=B0=E5=BD=93=E5=89=8D=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/login/login/starLock_login_logic.dart | 15 ++- .../doorLockLog/doorLockLog_logic.dart | 113 ++++++++++-------- .../doorLockLog/doorLockLog_page.dart | 91 +++++++------- .../lockDetail/lockDetail_logic.dart | 31 ++--- .../lockOperatingRecord_page.dart | 42 ++++--- .../lockSet/lockSet/lockSet_logic.dart | 91 +++++++------- lib/mine/mineSet/mineSet/mineSet_logic.dart | 20 ++-- lib/tools/advancedCalendar/src/widget.dart | 17 ++- lib/tools/bugly/bugly_tool.dart | 16 ++- 9 files changed, 235 insertions(+), 201 deletions(-) diff --git a/lib/login/login/starLock_login_logic.dart b/lib/login/login/starLock_login_logic.dart index 2b5e797e..fdd944c3 100755 --- a/lib/login/login/starLock_login_logic.dart +++ b/lib/login/login/starLock_login_logic.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:star_lock/appRouters.dart'; @@ -52,9 +51,9 @@ class StarLockLoginLogic extends BaseGetXController { deviceInfo: state.deviceInfoMap); if (entity.errorCode!.codeIsSuccessful) { UmengCommonSdk.onEvent('login_result', { - 'account':state.emailOrPhone.value, - 'date':DateTool().getNowDateWithType(1), - 'login_res':'成功', + 'account': state.emailOrPhone.value, + 'date': DateTool().getNowDateWithType(1), + 'login_res': '成功', }); Storage.saveLoginData(entity.data); @@ -65,11 +64,11 @@ class StarLockLoginLogic extends BaseGetXController { } Get.offNamedUntil(Routers.starLockMain, (Route route) => false); BlueManage().scanDevices.clear(); //清除设备缓存 - }else{ + } else { UmengCommonSdk.onEvent('login_result', { - 'account':state.emailOrPhone.value, - 'date':DateTool().getNowDateWithType(1), - 'login_res':'${entity.errorCode}--${entity.errorMsg}', + 'account': state.emailOrPhone.value, + 'date': DateTool().getNowDateWithType(1), + 'login_res': '${entity.errorCode}--${entity.errorMsg}', }); } } diff --git a/lib/main/lockDetail/doorLockLog/doorLockLog_logic.dart b/lib/main/lockDetail/doorLockLog/doorLockLog_logic.dart index 3f87c4ea..23d9a38e 100755 --- a/lib/main/lockDetail/doorLockLog/doorLockLog_logic.dart +++ b/lib/main/lockDetail/doorLockLog/doorLockLog_logic.dart @@ -26,7 +26,7 @@ import '../../../tools/storage.dart'; import '../lockOperatingRecord/keyOperationRecord_entity.dart'; class DoorLockLogLogic extends BaseGetXController { - DoorLockLogState state = DoorLockLogState(); + final DoorLockLogState state = DoorLockLogState(); // 获取解析后的数据 late StreamSubscription _replySubscription; @@ -47,8 +47,7 @@ class DoorLockLogLogic extends BaseGetXController { message: '查询锁记录结果,解析数据', detail: '查询锁记录结果,解析数据:${reply.data}', eventStr: '查询锁记录事件结果', - upload: true - ); + upload: true); state.isLockReceiveResponse = true; cancelBlueConnetctToastTimer(); @@ -121,13 +120,15 @@ class DoorLockLogLogic extends BaseGetXController { // 查询事件记录(时间查询) Future senderReferEventRecordTime() async { - final List? privateKey = await Storage.getStringList(saveBluePrivateKey); + final List? privateKey = + await Storage.getStringList(saveBluePrivateKey); final List getPrivateKeyList = changeStringListToIntList(privateKey!); final List? token = await Storage.getStringList(saveBlueToken); final List getTokenList = changeStringListToIntList(token!); - final List? publicKey = await Storage.getStringList(saveBluePublicKey); + final List? publicKey = + await Storage.getStringList(saveBluePublicKey); final List getPublicKeyList = changeStringListToIntList(publicKey!); final String command = SenderReferEventRecordTimeCommand( @@ -144,37 +145,45 @@ class DoorLockLogLogic extends BaseGetXController { ).toString(); showEasyLoading(); - showBlueConnetctToastTimer(isShowBlueConnetctToast:true, action: () async { - cancelBlueConnetctToastTimer(); + showBlueConnetctToastTimer( + isShowBlueConnetctToast: true, + action: () async { + cancelBlueConnetctToastTimer(); - final String getMobile = (await Storage.getMobile())!; - UmengCommonSdk.onEvent('check_doorLockLog', { - 'lockName':state.keyInfos.value.lockName!, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'open_lock_result':'超时', - }); + final String getMobile = (await Storage.getMobile())!; + UmengCommonSdk.onEvent('check_doorLockLog', { + 'lockName': state.keyInfos.value.lockName!, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'open_lock_result': '超时', + }); - BuglyTool.uploadException( - message: '查询锁记录超时-查询锁记录失败', - detail: '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command', - eventStr: '查询锁记录事件超时', - upload: true - ); - if(state.isLockReceiveResponse == false){ - dismissEasyLoading(); - } - }); - BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionStateState) async { + BuglyTool.uploadException( + message: '查询锁记录超时-查询锁记录失败', + detail: + '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command', + eventStr: '查询锁记录事件超时', + upload: true); + if (state.isLockReceiveResponse == false) { + dismissEasyLoading(); + } + }); + BlueManage().blueSendData(BlueManage().connectDeviceName, + (BluetoothConnectionState connectionStateState) async { if (connectionStateState == BluetoothConnectionState.connected) { - final List? privateKey = await Storage.getStringList(saveBluePrivateKey); - final List getPrivateKeyList = changeStringListToIntList(privateKey!); + final List? privateKey = + await Storage.getStringList(saveBluePrivateKey); + final List getPrivateKeyList = + changeStringListToIntList(privateKey!); final List? token = await Storage.getStringList(saveBlueToken); final List getTokenList = changeStringListToIntList(token!); - final List? publicKey = await Storage.getStringList(saveBluePublicKey); - final List getPublicKeyList = changeStringListToIntList(publicKey!); + final List? publicKey = + await Storage.getStringList(saveBluePublicKey); + final List getPublicKeyList = + changeStringListToIntList(publicKey!); IoSenderManage.senderReferEventRecordTimeCommand( keyID: BlueManage().connectDeviceName, @@ -188,7 +197,8 @@ class DoorLockLogLogic extends BaseGetXController { publicKey: getPublicKeyList, privateKey: getPrivateKeyList, ); - } else if (connectionStateState == BluetoothConnectionState.disconnected) { + } else if (connectionStateState == + BluetoothConnectionState.disconnected) { if (state.ifCurrentScreen.value == true) { showBlueConnetctToast(); } @@ -196,18 +206,19 @@ class DoorLockLogLogic extends BaseGetXController { final String getMobile = (await Storage.getMobile())!; UmengCommonSdk.onEvent('check_doorLockLog', { - 'lockName':state.keyInfos.value.lockName!, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'open_lock_result':'断开连接', + 'lockName': state.keyInfos.value.lockName!, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'open_lock_result': '断开连接', }); BuglyTool.uploadException( message: '查询锁记录超时-查询锁记录失败', - detail: '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command', + detail: + '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command', eventStr: '查询锁记录事件断开连接', - upload: true - ); + upload: true); } }); } @@ -238,7 +249,9 @@ class DoorLockLogLogic extends BaseGetXController { /// 刷新门锁日志列表 StreamSubscription? _getDoorLockLogListRefreshUIEvent; void _getDoorLockLogListRefreshUIAction() { - _getDoorLockLogListRefreshUIEvent = eventBus.on().listen((DoorLockLogListRefreshUI event) { + _getDoorLockLogListRefreshUIEvent = eventBus + .on() + .listen((DoorLockLogListRefreshUI event) { state.currentSelectDate.value = event.getDoorLockLogTime; // 设置startDate为当天的0点 @@ -281,7 +294,9 @@ class DoorLockLogLogic extends BaseGetXController { if (list.isEmpty) { return; } - final KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordUploadData(lockId: state.keyInfos.value.lockId.toString(), records: list); + final KeyOperationRecordEntity entity = await ApiRepository.to + .lockRecordUploadData( + lockId: state.keyInfos.value.lockId.toString(), records: list); final String getMobile = (await Storage.getMobile())!; if (entity.errorCode!.codeIsSuccessful) { if (state.ifHaveNext == true) { @@ -289,20 +304,22 @@ class DoorLockLogLogic extends BaseGetXController { getLockRecordLastUploadDataTime(); } else { UmengCommonSdk.onEvent('check_doorLockLog', { - 'lockName':state.keyInfos.value.lockName!, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'open_lock_result':'成功', + 'lockName': state.keyInfos.value.lockName!, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'open_lock_result': '成功', }); mockNetworkDataRequest(isRefresh: true); } dismissEasyLoading(); - }else{ + } else { UmengCommonSdk.onEvent('check_doorLockLog', { - 'lockName':state.keyInfos.value.lockName!, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'open_lock_result':'上传数据接口失败', + 'lockName': state.keyInfos.value.lockName!, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'open_lock_result': '上传数据接口失败', }); dismissEasyLoading(); } diff --git a/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart b/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart index c4c8d94c..561cf30b 100755 --- a/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart +++ b/lib/main/lockDetail/doorLockLog/doorLockLog_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -53,7 +52,9 @@ class _DoorLockLogPageState extends State with RouteAware { ), onTap: () { ShowTipView().showSureAlertDialog( - '1.锁没有联网,密码、IC卡、指纹等开门记录无法实时上传,可以点击右上角按钮,然后读取记录。'.tr +'\n' + '2.如果您需要保留历史记录,可以点击右上角按钮,然后导出记录'.tr, + '1.锁没有联网,密码、IC卡、指纹等开门记录无法实时上传,可以点击右上角按钮,然后读取记录。'.tr + + '\n' + + '2.如果您需要保留历史记录,可以点击右上角按钮,然后导出记录'.tr, tipTitle: '看不到操作记录,可能原因有'.tr, sureStr: '我知道了'.tr); }, @@ -121,25 +122,13 @@ class _DoorLockLogPageState extends State with RouteAware { } void _onMenuItemSelected(String value) { - if(value == '读取记录'.tr){ + if (value == '读取记录'.tr) { logic.mockNetworkDataRequest(isRefresh: true); - }else if(value == '清空记录'.tr){ - ShowCupertinoAlertView().showClearOperationRecordAlert( - clearClick: () { - switch (value) { - case '读取记录': - { - state.isLockReceiveResponse = false; - logic.getLockRecordLastUploadDataTime(); - } - break; - case '清空记录': - { - ShowCupertinoAlertView().showClearOperationRecordAlert( - clearClick: () { - logic.clearOperationRecordRequest(); - }); - }else if(value == '导出记录'.tr){ + } else if (value == '清空记录'.tr) { + ShowCupertinoAlertView().showClearOperationRecordAlert(clearClick: () { + logic.clearOperationRecordRequest(); + }); + } else if (value == '导出记录'.tr) { showDialog( context: context, builder: (BuildContext context) { @@ -152,38 +141,38 @@ class _DoorLockLogPageState extends State with RouteAware { }, ); } - - // switch (value) { - // case "读取记录".tr: - // { - // logic.mockNetworkDataRequest(isRefresh: true); - // } - // break; - // case '清空记录'.tr: - // { - // ShowCupertinoAlertView().showClearOperationRecordAlert( - // clearClick: () { - // logic.clearOperationRecordRequest(); - // }); - // } - // break; - // case '导出记录': - // { - // showDialog( - // context: context, - // builder: (BuildContext context) { - // return ExportRecordDialog( - // onExport: (String filePath) { - // Get.toNamed(Routers.exportSuccessPage, - // arguments: {'filePath': filePath}); - // }, - // ); - // }, - // ); - // } - // break; - // } } + // switch (value) { + // case "读取记录".tr: + // { + // logic.mockNetworkDataRequest(isRefresh: true); + // } + // break; + // case '清空记录'.tr: + // { + // ShowCupertinoAlertView().showClearOperationRecordAlert( + // clearClick: () { + // logic.clearOperationRecordRequest(); + // }); + // } + // break; + // case '导出记录': + // { + // showDialog( + // context: context, + // builder: (BuildContext context) { + // return ExportRecordDialog( + // onExport: (String filePath) { + // Get.toNamed(Routers.exportSuccessPage, + // arguments: {'filePath': filePath}); + // }, + // ); + // }, + // ); + // } + // break; + // } + // } //顶部日历小部件 Widget topAdvancedCalendarWidget() { diff --git a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index 56ba98ed..e6cf086b 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -69,13 +69,14 @@ class LockDetailLogic extends BaseGetXController { detail: '开锁结果,解析数据 _replyOpenLock:${reply.data}', upload: true); - if(status != 6){ + if (status != 6) { final String getMobile = (await Storage.getMobile())!; UmengCommonSdk.onEvent('open_lock', { - 'lock_name':state.keyInfos.value.lockName!, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'open_lock_result':'${reply.data}', + 'lock_name': state.keyInfos.value.lockName!, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'open_lock_result': '${reply.data}', }); } @@ -378,10 +379,11 @@ class LockDetailLogic extends BaseGetXController { action: () async { final String getMobile = (await Storage.getMobile())!; UmengCommonSdk.onEvent('open_lock', { - 'lock_name':state.keyInfos.value.lockName!, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'open_lock_result':'超时', + 'lock_name': state.keyInfos.value.lockName!, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'open_lock_result': '超时', }); resetOpenDoorState(); @@ -419,14 +421,13 @@ class LockDetailLogic extends BaseGetXController { message: '蓝牙连接失败-开锁失败', detail: '蓝牙连接失败,断开连接, 开锁失败--OpenLockCommand:$command', upload: true); - upload: true - ); final String getMobile = (await Storage.getMobile())!; UmengCommonSdk.onEvent('open_lock', { - 'lock_name':state.keyInfos.value.lockName!, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'open_lock_result':'断开连接', + 'lock_name': state.keyInfos.value.lockName!, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'open_lock_result': '断开连接', }); if (state.ifCurrentScreen.value == true) { diff --git a/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart b/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart index cd346e51..1de474fa 100755 --- a/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart +++ b/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -19,17 +18,20 @@ class LockOperatingRecordPage extends StatefulWidget { const LockOperatingRecordPage({Key? key}) : super(key: key); @override - State createState() => _LockOperatingRecordPageState(); + State createState() => + _LockOperatingRecordPageState(); } -class _LockOperatingRecordPageState extends State with RouteAware{ +class _LockOperatingRecordPageState extends State + with RouteAware { final LockOperatingRecordLogic logic = Get.put(LockOperatingRecordLogic()); - final LockOperatingRecordState state = Get.find().state; + final LockOperatingRecordState state = + Get.find().state; Future getHttpData() async { final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); if (isDemoMode == false) { - logic.mockNetworkDataRequest().then((KeyOperationRecordEntity value){ + logic.mockNetworkDataRequest().then((KeyOperationRecordEntity value) { if (mounted) { setState(() {}); } @@ -49,7 +51,9 @@ class _LockOperatingRecordPageState extends State with return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: state.recordName.value.isNotEmpty? state.recordName.value : '操作记录'.tr, + barTitle: state.recordName.value.isNotEmpty + ? state.recordName.value + : '操作记录'.tr, haveBack: true, backgroundColor: AppColors.mainColor, // actionsList: [ @@ -75,11 +79,11 @@ class _LockOperatingRecordPageState extends State with // ], ), body: EasyRefreshTool( - onRefresh: (){ + onRefresh: () { logic.pageNo = 1; getHttpData(); }, - onLoad: (){ + onLoad: () { getHttpData(); }, child: Column( @@ -138,7 +142,10 @@ class _LockOperatingRecordPageState extends State with ); }, ) - : NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight)); + : NoData( + noDataHeight: 1.sh - + ScreenUtil().statusBarHeight - + ScreenUtil().bottomBarHeight)); } String getTypeIcon(int type) { @@ -166,7 +173,8 @@ class _LockOperatingRecordPageState extends State with return title; } - Widget _operatingOneRecordItem(String userAvatarStr, String userNameStr, String unlockDescStr, Function() action) { + Widget _operatingOneRecordItem(String userAvatarStr, String userNameStr, + String unlockDescStr, Function() action) { return GestureDetector( onTap: action, child: Container( @@ -181,23 +189,23 @@ class _LockOperatingRecordPageState extends State with mainAxisAlignment: MainAxisAlignment.start, children: [ Icon(Icons.access_time, size: 35.w), - SizedBox(width: 10.w,), + SizedBox( + width: 10.w, + ), Text( unlockDescStr, textAlign: TextAlign.center, style: TextStyle( - fontSize: 24.sp, - color: AppColors.darkGrayTextColor), + fontSize: 24.sp, color: AppColors.darkGrayTextColor), ), SizedBox(width: 10.h), Expanded( - child:Container( + child: Container( margin: EdgeInsets.only(bottom: 3.w), child: Row( children: [ Flexible( - child: Text( - userNameStr, + child: Text(userNameStr, maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle( @@ -298,6 +306,7 @@ class _LockOperatingRecordPageState extends State with @override void didChangeDependencies() { super.didChangeDependencies(); + /// 路由订阅 AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!); } @@ -344,5 +353,4 @@ class _LockOperatingRecordPageState extends State with } state.ifCurrentScreen.value = false; } - } diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSet_logic.dart b/lib/main/lockDetail/lockSet/lockSet/lockSet_logic.dart index 2d5e576a..1f33e666 100755 --- a/lib/main/lockDetail/lockSet/lockSet/lockSet_logic.dart +++ b/lib/main/lockDetail/lockSet/lockSet/lockSet_logic.dart @@ -1,4 +1,3 @@ - import 'dart:async'; import 'package:flutter/scheduler.dart'; @@ -126,11 +125,15 @@ class LockSetLogic extends BaseGetXController { break; case 0x06: //无权限 - final List? privateKey = await Storage.getStringList(saveBluePrivateKey); - final List getPrivateKeyList = changeStringListToIntList(privateKey!); + final List? privateKey = + await Storage.getStringList(saveBluePrivateKey); + final List getPrivateKeyList = + changeStringListToIntList(privateKey!); - final List? publicKey = await Storage.getStringList(saveBluePublicKey); - final List publicKeyDataList = changeStringListToIntList(publicKey!); + final List? publicKey = + await Storage.getStringList(saveBluePublicKey); + final List publicKeyDataList = + changeStringListToIntList(publicKey!); final List? token = await Storage.getStringList(saveBlueToken); final List getTokenList = changeStringListToIntList(token!); @@ -292,11 +295,12 @@ class LockSetLogic extends BaseGetXController { action: () async { final String getMobile = (await Storage.getMobile())!; UmengCommonSdk.onEvent('delet_lock', { - 'lock_name':BlueManage().connectDeviceName, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'delet_type':'lock', - 'delet_lock_result':'删除锁超时', + 'lock_name': BlueManage().connectDeviceName, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'delet_type': 'lock', + 'delet_lock_result': '删除锁超时', }); dismissEasyLoading(); @@ -329,11 +333,12 @@ class LockSetLogic extends BaseGetXController { } else if (connectionState == BluetoothConnectionState.disconnected) { final String getMobile = (await Storage.getMobile())!; UmengCommonSdk.onEvent('delet_lock', { - 'lock_name':BlueManage().connectDeviceName, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'delet_type':'lock', - 'delet_lock_result':'删除锁断开', + 'lock_name': BlueManage().connectDeviceName, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'delet_type': 'lock', + 'delet_lock_result': '删除锁断开', }); dismissEasyLoading(); @@ -373,7 +378,7 @@ class LockSetLogic extends BaseGetXController { // 设置支持功能(带参数) Future sendBurglarAlarm(int type) async { - if(state.sureBtnState.value == 1){ + if (state.sureBtnState.value == 1) { return; } state.sureBtnState.value = 1; @@ -553,10 +558,12 @@ class LockSetLogic extends BaseGetXController { void deleyLockLogicOfRoles() { if (state.lockBasicInfo.value.isLockOwner == 1) { // 超级管理员必须通过连接蓝牙删除q - state.showTipView.showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () { + state.showTipView + .showIosTipWithContentDialog('删除锁后,所有信息都会一起删除,确定删除锁吗?'.tr, () { // 删除锁 state.showTipView.resetGetController(); - state.showTipView.showTFViewAlertDialog(state.passwordTF, '请输入登录密码'.tr, '请输入登录密码'.tr, checkLoginPassword); + state.showTipView.showTFViewAlertDialog( + state.passwordTF, '请输入登录密码'.tr, '请输入登录密码'.tr, checkLoginPassword); }); } else if (state.lockBasicInfo.value.keyRight == 1) { // 授权管理员弹框提示 @@ -591,11 +598,12 @@ class LockSetLogic extends BaseGetXController { final String getMobile = (await Storage.getMobile())!; if (entity.errorCode!.codeIsSuccessful) { UmengCommonSdk.onEvent('delet_lock', { - 'lock_name':BlueManage().connectDeviceName, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'delet_type':'lock', - 'delet_lock_result':'成功', + 'lock_name': BlueManage().connectDeviceName, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'delet_type': 'lock', + 'delet_lock_result': '成功', }); BlueManage().connectDeviceMacAddress = ''; @@ -607,13 +615,14 @@ class LockSetLogic extends BaseGetXController { SchedulerBinding.instance.addPostFrameCallback((_) { eventBus.fire(RefreshLockListInfoDataEvent()); }); - }else{ + } else { UmengCommonSdk.onEvent('delet_lock', { - 'lock_name':BlueManage().connectDeviceName, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'delet_type':'lock', - 'delet_lock_result':'${entity.errorCode}--${entity.errorMsg}', + 'lock_name': BlueManage().connectDeviceName, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'delet_type': 'lock', + 'delet_lock_result': '${entity.errorCode}--${entity.errorMsg}', }); } } @@ -628,11 +637,12 @@ class LockSetLogic extends BaseGetXController { final String getMobile = (await Storage.getMobile())!; if (entity.errorCode!.codeIsSuccessful) { UmengCommonSdk.onEvent('delet_lock', { - 'lock_name':BlueManage().connectDeviceName, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'delet_type':'key', - 'delet_lock_result':'成功', + 'lock_name': BlueManage().connectDeviceName, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'delet_type': 'key', + 'delet_lock_result': '成功', }); BlueManage().connectDeviceMacAddress = ''; @@ -644,13 +654,14 @@ class LockSetLogic extends BaseGetXController { SchedulerBinding.instance.addPostFrameCallback((_) { eventBus.fire(RefreshLockListInfoDataEvent()); }); - }else{ + } else { UmengCommonSdk.onEvent('delet_lock', { - 'lock_name':BlueManage().connectDeviceName, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'delet_type':'key', - 'delet_lock_result':'${entity.errorCode}--${entity.errorMsg}', + 'lock_name': BlueManage().connectDeviceName, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'delet_type': 'key', + 'delet_lock_result': '${entity.errorCode}--${entity.errorMsg}', }); } } diff --git a/lib/mine/mineSet/mineSet/mineSet_logic.dart b/lib/mine/mineSet/mineSet/mineSet_logic.dart index 78839b76..5cbcee65 100755 --- a/lib/mine/mineSet/mineSet/mineSet_logic.dart +++ b/lib/mine/mineSet/mineSet/mineSet_logic.dart @@ -135,10 +135,11 @@ class MineSetLogic extends BaseGetXController { final String getMobile = (await Storage.getMobile())!; if (entity.errorCode!.codeIsSuccessful) { UmengCommonSdk.onEvent('logout', { - 'lock_name':BlueManage().connectDeviceName, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'logout_result':'成功', + 'lock_name': BlueManage().connectDeviceName, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'logout_result': '成功', }); UdpHelp().closeUDP(); @@ -150,12 +151,13 @@ class MineSetLogic extends BaseGetXController { BlueManage().disconnect(); XSJPushProvider().initLocalNotification(isCancelLocalPush: true); Get.offNamedUntil(Routers.starLockLoginPage, (Route route) => false); - }else{ + } else { UmengCommonSdk.onEvent('logout', { - 'lock_name':BlueManage().connectDeviceName, - 'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date':DateTool().getNowDateWithType(1), - 'logout_result':'${entity.errorCode}--${entity.errorMsg}', + 'lock_name': BlueManage().connectDeviceName, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'logout_result': '${entity.errorCode}--${entity.errorMsg}', }); } } diff --git a/lib/tools/advancedCalendar/src/widget.dart b/lib/tools/advancedCalendar/src/widget.dart index 57d42a23..62dac000 100755 --- a/lib/tools/advancedCalendar/src/widget.dart +++ b/lib/tools/advancedCalendar/src/widget.dart @@ -218,7 +218,15 @@ class _AdvancedCalendarState extends State keepLineSize: widget.keepLineSize, weekNames: _weekNames != null ? _weekNames! - : ['简写周日'.tr, '简写周一'.tr, '简写周二'.tr, '简写周三'.tr, '简写周四'.tr, '简写周五'.tr, '简写周六'.tr], + : [ + '简写周日'.tr, + '简写周一'.tr, + '简写周二'.tr, + '简写周三'.tr, + '简写周四'.tr, + '简写周五'.tr, + '简写周六'.tr + ], ), AnimatedBuilder( animation: _animationController, @@ -324,7 +332,8 @@ class _AdvancedCalendarState extends State controller: _weekPageController, itemCount: _weekRangeList.length, physics: _closeMonthScroll(), - itemBuilder: (BuildContext context, int index) { + itemBuilder: (BuildContext context, + int index) { return WeekView( innerDot: widget.innerDot, dates: _weekRangeList[index], @@ -384,8 +393,8 @@ class _AdvancedCalendarState extends State void _handleWeekDateChanged(DateTime date) { _handleDateChanged(date); - _monthViewCurrentPage.value = _monthRangeList - .lastIndexWhere((ViewRange monthRange) => monthRange.dates.contains(date)); + _monthViewCurrentPage.value = _monthRangeList.lastIndexWhere( + (ViewRange monthRange) => monthRange.dates.contains(date)); } void _handleDateChanged(DateTime date) { diff --git a/lib/tools/bugly/bugly_tool.dart b/lib/tools/bugly/bugly_tool.dart index 35869076..f87f74d4 100644 --- a/lib/tools/bugly/bugly_tool.dart +++ b/lib/tools/bugly/bugly_tool.dart @@ -1,4 +1,3 @@ - import 'dart:async'; import 'package:flutter/foundation.dart'; @@ -13,7 +12,6 @@ import 'package:star_lock/tools/storage.dart'; /// /// class BuglyTool { - static int time = 0; static Future init() async { @@ -69,27 +67,27 @@ class BuglyTool { bool begin = false, Map? data, }) async { - String getMessage = '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- message:$message detail:$detail'; - if(begin == true){ + String getMessage = + '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- message:$message detail:$detail'; + if (begin == true) { // 开始 uploadStr = ''; - }else{ + } else { uploadStr = '$uploadStr \n<----------->\n $getMessage'; } - if(upload){ + if (upload) { // AppLog.log('message:${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- 开门事件 detail:$uploadStr'); // FlutterBugly.uploadException(message: '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+$time --- 开门事件', detail: uploadStr, data: data); - BuglyTool.uploadExceptionWithEvent(eventStr:eventStr, detail: uploadStr); + BuglyTool.uploadExceptionWithEvent(eventStr: eventStr, detail: uploadStr); } } - static Future uploadExceptionWithEvent({ required String eventStr, required String detail, }) async { - FlutterBugly.uploadException(message: '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+${time == 0 ? DateTime.now().millisecondsSinceEpoch : 0}--- $eventStr', detail: detail); + // FlutterBugly.uploadException(message: '${(await Storage.getMobile())!.isNotEmpty ? (await Storage.getMobile()) : (await Storage.getEmail())}+${time == 0 ? DateTime.now().millisecondsSinceEpoch : 0}--- $eventStr', detail: detail); } }