2023-08-16 18:21:42 +08:00
|
|
|
|
import 'dart:async';
|
2024-03-09 17:17:38 +08:00
|
|
|
|
import 'dart:io';
|
2023-08-16 18:21:42 +08:00
|
|
|
|
|
2024-03-28 13:46:35 +08:00
|
|
|
|
import 'package:flutter/scheduler.dart';
|
2024-03-18 16:16:51 +08:00
|
|
|
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
2024-01-05 13:56:34 +08:00
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
import 'package:intl/intl.dart';
|
2024-03-09 17:17:38 +08:00
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
2024-03-19 18:04:51 +08:00
|
|
|
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
2024-02-28 15:27:10 +08:00
|
|
|
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
2024-03-21 11:36:48 +08:00
|
|
|
|
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
2023-08-16 18:21:42 +08:00
|
|
|
|
|
|
|
|
|
|
import '../../../blue/blue_manage.dart';
|
2023-12-16 11:20:36 +08:00
|
|
|
|
import '../../../blue/io_protocol/io_addUser.dart';
|
2023-08-16 18:21:42 +08:00
|
|
|
|
import '../../../blue/io_protocol/io_openLock.dart';
|
2023-11-13 11:28:42 +08:00
|
|
|
|
import '../../../blue/io_protocol/io_referEventRecordTime.dart';
|
2023-08-31 15:56:01 +08:00
|
|
|
|
import '../../../blue/io_reply.dart';
|
2023-08-16 18:21:42 +08:00
|
|
|
|
import '../../../blue/io_tool/io_tool.dart';
|
|
|
|
|
|
import '../../../blue/io_tool/manager_event_bus.dart';
|
|
|
|
|
|
import '../../../blue/sender_manage.dart';
|
2023-08-30 14:55:42 +08:00
|
|
|
|
import '../../../network/api_repository.dart';
|
2024-04-16 17:44:38 +08:00
|
|
|
|
import '../../../permission/permission_dialog.dart';
|
2023-08-16 18:21:42 +08:00
|
|
|
|
import '../../../tools/baseGetXController.dart';
|
2024-04-25 17:45:00 +08:00
|
|
|
|
import '../../../tools/commonDataManage.dart';
|
2023-10-20 11:58:40 +08:00
|
|
|
|
import '../../../tools/eventBusEventManage.dart';
|
2023-08-16 18:21:42 +08:00
|
|
|
|
import '../../../tools/storage.dart';
|
2024-03-19 18:04:51 +08:00
|
|
|
|
import '../../../translations/trans_lib.dart';
|
2023-11-13 11:28:42 +08:00
|
|
|
|
import '../lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
2023-08-16 18:21:42 +08:00
|
|
|
|
import 'lockDetail_state.dart';
|
2023-11-24 14:23:36 +08:00
|
|
|
|
import 'lockNetToken_entity.dart';
|
2023-08-16 18:21:42 +08:00
|
|
|
|
|
2024-01-02 15:42:41 +08:00
|
|
|
|
class LockDetailLogic extends BaseGetXController {
|
2023-08-16 18:21:42 +08:00
|
|
|
|
final LockDetailState state = LockDetailState();
|
|
|
|
|
|
|
2023-08-24 14:25:55 +08:00
|
|
|
|
// 监听设备返回的数据
|
2024-03-23 11:23:38 +08:00
|
|
|
|
void initReplySubscription() {
|
2024-04-11 17:06:06 +08:00
|
|
|
|
state.replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
2024-04-24 16:04:07 +08:00
|
|
|
|
// Get.log("锁详情收到了蓝牙解析消息 reply:${reply.commandType}");
|
2023-08-24 14:25:55 +08:00
|
|
|
|
// 开门
|
2024-03-23 11:23:38 +08:00
|
|
|
|
if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) {
|
2023-08-16 18:21:42 +08:00
|
|
|
|
_replyOpenLock(reply);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-18 16:25:41 +08:00
|
|
|
|
// 编辑锁用户
|
2023-11-24 14:23:36 +08:00
|
|
|
|
// if(reply is EditUserReply){
|
|
|
|
|
|
// _replyEditUserKey(reply);
|
|
|
|
|
|
// }
|
2023-08-24 14:25:55 +08:00
|
|
|
|
|
2023-10-07 18:55:59 +08:00
|
|
|
|
// 获取星锁状态信息
|
2024-03-12 16:19:04 +08:00
|
|
|
|
// if (reply is GetStarLockStatuInfoReply && state.ifCurrentScreen.value == true) {
|
|
|
|
|
|
// _replyGetStarLockStatusInfo(reply);
|
|
|
|
|
|
// }
|
2023-11-13 11:28:42 +08:00
|
|
|
|
|
|
|
|
|
|
// 开完锁之后上传记录
|
2024-03-21 11:36:48 +08:00
|
|
|
|
if (reply is SenderReferEventRecordTimeReply &&
|
|
|
|
|
|
state.ifCurrentScreen.value == true) {
|
2023-11-13 11:28:42 +08:00
|
|
|
|
_replyReferEventRecordTime(reply);
|
|
|
|
|
|
}
|
2023-12-16 11:20:36 +08:00
|
|
|
|
|
|
|
|
|
|
// 添加用户
|
2024-04-23 15:15:56 +08:00
|
|
|
|
// if ((reply is AddUserReply) && (state.ifCurrentScreen.value == true)) {
|
|
|
|
|
|
// _replyAddUserKey(reply);
|
|
|
|
|
|
// }
|
2023-08-16 18:21:42 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-24 14:25:55 +08:00
|
|
|
|
// 开门数据解析
|
2023-08-16 18:21:42 +08:00
|
|
|
|
Future<void> _replyOpenLock(Reply reply) async {
|
2024-01-02 15:42:41 +08:00
|
|
|
|
int status = reply.data[6];
|
|
|
|
|
|
|
|
|
|
|
|
switch (status) {
|
|
|
|
|
|
case 0x00:
|
|
|
|
|
|
//成功
|
2024-03-23 11:23:38 +08:00
|
|
|
|
Get.log("${reply.commandType}数据解析成功");
|
2024-01-06 16:26:13 +08:00
|
|
|
|
// _showFullScreenOverlay(Get.context!);
|
|
|
|
|
|
|
|
|
|
|
|
state.iSClosedUnlockSuccessfulPopup.value = true;
|
2024-03-21 11:36:48 +08:00
|
|
|
|
if (state.closedUnlockSuccessfulTimer != null) {
|
2024-01-06 16:26:13 +08:00
|
|
|
|
state.closedUnlockSuccessfulTimer!.cancel();
|
|
|
|
|
|
state.closedUnlockSuccessfulTimer = null;
|
|
|
|
|
|
}
|
|
|
|
|
|
// 如果没有点击关闭弹窗,3秒后自动关闭
|
|
|
|
|
|
state.closedUnlockSuccessfulTimer = Timer.periodic(3.seconds, (timer) {
|
|
|
|
|
|
state.iSClosedUnlockSuccessfulPopup.value = false;
|
|
|
|
|
|
timer.cancel();
|
2024-03-12 16:19:04 +08:00
|
|
|
|
eventBus.fire(RefreshLockDetailInfoDataEvent());
|
2024-01-06 16:26:13 +08:00
|
|
|
|
});
|
2024-01-02 15:42:41 +08:00
|
|
|
|
|
|
|
|
|
|
// 电量
|
|
|
|
|
|
int power = reply.data[7];
|
|
|
|
|
|
state.electricQuantity.value = power;
|
|
|
|
|
|
|
2024-01-05 13:56:34 +08:00
|
|
|
|
cancelBlueConnetctToastTimer();
|
2024-01-02 15:42:41 +08:00
|
|
|
|
getLockRecordLastUploadDataTime();
|
2024-01-04 18:27:50 +08:00
|
|
|
|
state.openLockBtnState.value = 0;
|
2024-03-12 16:19:04 +08:00
|
|
|
|
|
|
|
|
|
|
eventBus.fire(RefreshLockDetailInfoDataEvent());
|
2024-01-02 15:42:41 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 0x06:
|
|
|
|
|
|
//无权限
|
2024-03-23 11:23:38 +08:00
|
|
|
|
Get.log("${reply.commandType}需要鉴权");
|
2024-01-02 15:42:41 +08:00
|
|
|
|
|
|
|
|
|
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
|
|
|
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
|
|
|
|
|
|
|
|
|
|
var signKey = await Storage.getStringList(saveBlueSignKey);
|
|
|
|
|
|
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
2023-08-16 18:21:42 +08:00
|
|
|
|
|
2024-01-03 15:33:53 +08:00
|
|
|
|
var tokenData = reply.data.sublist(2, 6);
|
|
|
|
|
|
var saveStrList = changeIntListToStringList(tokenData);
|
|
|
|
|
|
Storage.setStringList(saveBlueToken, saveStrList);
|
2024-04-07 14:03:59 +08:00
|
|
|
|
// Get.log("openDoorToken:$tokenData");
|
2024-01-03 15:33:53 +08:00
|
|
|
|
|
2024-01-02 15:42:41 +08:00
|
|
|
|
IoSenderManage.senderOpenLock(
|
|
|
|
|
|
keyID: BlueManage().connectDeviceName,
|
|
|
|
|
|
userID: await Storage.getUid(),
|
2024-04-01 16:21:46 +08:00
|
|
|
|
openMode: state.openDoorModel,
|
2024-01-02 15:42:41 +08:00
|
|
|
|
openTime: DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
|
|
|
|
|
onlineToken: state.lockNetToken,
|
|
|
|
|
|
token: tokenData,
|
|
|
|
|
|
needAuthor: 1,
|
|
|
|
|
|
signKey: signKeyDataList,
|
|
|
|
|
|
privateKey: getPrivateKeyList,
|
|
|
|
|
|
);
|
2023-08-16 18:21:42 +08:00
|
|
|
|
|
2024-01-02 15:42:41 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 0x07:
|
2023-08-16 18:21:42 +08:00
|
|
|
|
//无权限
|
2024-04-07 14:03:59 +08:00
|
|
|
|
Get.log("${reply.commandType}用户无权限");
|
2023-08-16 18:21:42 +08:00
|
|
|
|
|
2024-01-02 15:42:41 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 0x09:
|
2023-08-16 18:21:42 +08:00
|
|
|
|
// 权限校验错误
|
2024-04-07 14:03:59 +08:00
|
|
|
|
Get.log("${reply.commandType}校验错误");
|
2023-08-16 18:21:42 +08:00
|
|
|
|
|
2024-01-26 14:10:57 +08:00
|
|
|
|
break;
|
|
|
|
|
|
case 0x16:
|
2024-02-28 15:27:10 +08:00
|
|
|
|
// 正在开锁中...
|
2024-04-07 14:03:59 +08:00
|
|
|
|
Get.log("${reply.commandType}正在开锁中...");
|
2024-01-29 17:23:45 +08:00
|
|
|
|
state.openLockBtnState.value = 0;
|
2024-03-12 16:19:04 +08:00
|
|
|
|
eventBus.fire(RefreshLockDetailInfoDataEvent());
|
2024-04-07 14:03:59 +08:00
|
|
|
|
showToast("正在开锁中...".tr, something: () {
|
2024-01-29 17:23:45 +08:00
|
|
|
|
cancelBlueConnetctToastTimer();
|
|
|
|
|
|
});
|
2024-01-02 15:42:41 +08:00
|
|
|
|
break;
|
|
|
|
|
|
default:
|
2023-08-16 18:21:42 +08:00
|
|
|
|
//失败
|
2024-01-02 15:42:41 +08:00
|
|
|
|
print("${reply.commandType}失败");
|
2023-08-16 18:21:42 +08:00
|
|
|
|
|
2024-01-02 15:42:41 +08:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2023-08-16 18:21:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-11-24 14:23:36 +08:00
|
|
|
|
// 获取锁状态数据解析
|
2024-03-12 16:19:04 +08:00
|
|
|
|
// Future<void> _replyGetStarLockStatusInfo(Reply reply) async {
|
|
|
|
|
|
// int status = reply.data[2];
|
|
|
|
|
|
// switch (status) {
|
|
|
|
|
|
// case 0x00:
|
|
|
|
|
|
// //成功
|
|
|
|
|
|
// print("${reply.commandType}数据解析成功");
|
|
|
|
|
|
// dismissEasyLoading();
|
|
|
|
|
|
// cancelBlueConnetctToastTimer();
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 厂商名称
|
|
|
|
|
|
// var vendor = reply.data.sublist(3, 23);
|
|
|
|
|
|
// // print("vendor:$vendor");
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 锁设备类型
|
|
|
|
|
|
// var product = reply.data[23];
|
|
|
|
|
|
// // print("product:$product");
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 产品名称
|
|
|
|
|
|
// var model = reply.data.sublist(24, 44);
|
|
|
|
|
|
// // print("model:$model");
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 软件版本
|
|
|
|
|
|
// var fwVersion = reply.data.sublist(44, 64);
|
|
|
|
|
|
// // print("fwVersion:$fwVersion");
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 硬件版本
|
|
|
|
|
|
// var hwVersion = reply.data.sublist(64, 84);
|
|
|
|
|
|
// // print("hwVersion:$hwVersion");
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 厂商序列号
|
|
|
|
|
|
// var serialNum0 = reply.data.sublist(84, 100);
|
|
|
|
|
|
// // print("serialNum0:$serialNum0");
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 成品商序列号
|
|
|
|
|
|
// var serialNum1 = reply.data.sublist(100, 116);
|
|
|
|
|
|
// // print("serialNum1:$serialNum1");
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 蓝牙名称
|
|
|
|
|
|
// var btDeviceName = reply.data.sublist(116, 132);
|
|
|
|
|
|
// // print("btDeviceName:$btDeviceName");
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 电池剩余电量
|
|
|
|
|
|
// var battRemCap = reply.data[132];
|
|
|
|
|
|
// // print("battRemCap:$battRemCap");
|
|
|
|
|
|
// // uploadElectricQuantityRequest(battRemCap.toString());
|
|
|
|
|
|
// // 重置次数
|
|
|
|
|
|
// var restoreCounter = reply.data.sublist(133, 135);
|
|
|
|
|
|
// // print("restoreCounter:$restoreCounter");
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 重置时间
|
|
|
|
|
|
// var restoreDate = reply.data.sublist(135, 139);
|
|
|
|
|
|
// // print("restoreDate:$restoreDate");
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 主控芯片型号
|
|
|
|
|
|
// var icPartNo = reply.data.sublist(139, 149);
|
|
|
|
|
|
// // print("icPartNo:$icPartNo");
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 有效时间
|
|
|
|
|
|
// var indate = reply.data.sublist(149, 153);
|
|
|
|
|
|
// // print("indate:$indate");
|
|
|
|
|
|
//
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// case 0x06:
|
|
|
|
|
|
// //无权限
|
|
|
|
|
|
// print("${reply.commandType}需要鉴权");
|
|
|
|
|
|
//
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// case 0x07:
|
|
|
|
|
|
// //无权限
|
|
|
|
|
|
// print("${reply.commandType}用户无权限");
|
|
|
|
|
|
//
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// case 0x09:
|
|
|
|
|
|
// // 权限校验错误
|
|
|
|
|
|
// print("${reply.commandType}权限校验错误");
|
|
|
|
|
|
//
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// default:
|
|
|
|
|
|
// //失败
|
|
|
|
|
|
// print("${reply.commandType}失败");
|
|
|
|
|
|
//
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
2023-10-07 18:55:59 +08:00
|
|
|
|
|
2023-11-13 11:28:42 +08:00
|
|
|
|
// 根据时间查解析数据
|
|
|
|
|
|
Future<void> _replyReferEventRecordTime(Reply reply) async {
|
|
|
|
|
|
int status = reply.data[2];
|
2024-01-02 15:42:41 +08:00
|
|
|
|
switch (status) {
|
2023-11-13 11:28:42 +08:00
|
|
|
|
case 0x00:
|
2024-01-02 15:42:41 +08:00
|
|
|
|
//成功
|
2024-03-23 11:23:38 +08:00
|
|
|
|
Get.log("${reply.commandType}数据解析成功");
|
2024-01-02 15:42:41 +08:00
|
|
|
|
if (reply.data[5] > 0) {
|
2023-11-13 11:28:42 +08:00
|
|
|
|
reply.data.removeRange(0, 6);
|
|
|
|
|
|
// 把得到的数据按8位分割成数组 然后塞进一个新的数组里面
|
|
|
|
|
|
var getList = splitList(reply.data, 8);
|
2023-11-24 14:23:36 +08:00
|
|
|
|
// print("getList:$getList");
|
2023-11-13 11:28:42 +08:00
|
|
|
|
var uploadList = [];
|
2024-01-02 15:42:41 +08:00
|
|
|
|
for (int i = 0; i < getList.length; i++) {
|
2023-11-13 11:28:42 +08:00
|
|
|
|
var indexList = getList[i];
|
2023-11-24 14:23:36 +08:00
|
|
|
|
// print("indexList:$indexList");
|
2023-11-13 11:28:42 +08:00
|
|
|
|
var indexMap = {};
|
|
|
|
|
|
indexMap["seq"] = indexList[0].toString();
|
|
|
|
|
|
indexMap["user"] = indexList[3].toString();
|
|
|
|
|
|
indexMap["pwd"] = indexList[2].toString();
|
|
|
|
|
|
indexMap["success"] = "1";
|
|
|
|
|
|
indexMap["type"] = indexList[1].toString();
|
|
|
|
|
|
|
|
|
|
|
|
int value = ((0xff & indexList[(4)]) << 24 |
|
2024-01-02 15:42:41 +08:00
|
|
|
|
(0xff & indexList[5]) << 16 |
|
|
|
|
|
|
(0xff & indexList[6]) << 8 |
|
|
|
|
|
|
(0xFF & indexList[7]));
|
2023-11-13 11:28:42 +08:00
|
|
|
|
// indexMap["date"] = DateTool().dateToYMDHNSString("$value");
|
|
|
|
|
|
// print("value:${DateTool().dateToYMDHNSString("$value")}");
|
|
|
|
|
|
|
2024-01-02 15:42:41 +08:00
|
|
|
|
indexMap["date"] = "${value * 1000}";
|
2023-11-13 11:28:42 +08:00
|
|
|
|
uploadList.add(indexMap);
|
|
|
|
|
|
}
|
|
|
|
|
|
lockRecordUploadData(uploadList);
|
|
|
|
|
|
// print("reply.data:${reply.data} getList:$getList}");
|
2024-03-18 16:16:51 +08:00
|
|
|
|
await BlueManage().disconnect();
|
2023-11-13 11:28:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x06:
|
2024-01-02 15:42:41 +08:00
|
|
|
|
//无权限
|
2024-03-23 11:23:38 +08:00
|
|
|
|
Get.log("${reply.commandType}需要鉴权");
|
2023-11-13 11:28:42 +08:00
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x07:
|
2024-01-02 15:42:41 +08:00
|
|
|
|
//无权限
|
2024-03-23 11:23:38 +08:00
|
|
|
|
Get.log("${reply.commandType}用户无权限");
|
2023-11-13 11:28:42 +08:00
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x09:
|
2024-01-02 15:42:41 +08:00
|
|
|
|
// 权限校验错误
|
2024-03-23 11:23:38 +08:00
|
|
|
|
Get.log("${reply.commandType}权限校验错误");
|
2023-11-13 11:28:42 +08:00
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
2024-01-02 15:42:41 +08:00
|
|
|
|
//失败
|
2024-03-23 11:23:38 +08:00
|
|
|
|
Get.log("${reply.commandType}失败");
|
2023-11-13 11:28:42 +08:00
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-04-23 15:15:56 +08:00
|
|
|
|
// // 添加用户
|
|
|
|
|
|
// Future<void> _replyAddUserKey(Reply reply) async {
|
|
|
|
|
|
// var lockId = reply.data.sublist(2, 42);
|
|
|
|
|
|
// // print("lockId:$lockId");
|
|
|
|
|
|
//
|
|
|
|
|
|
// var token = reply.data.sublist(42, 46);
|
|
|
|
|
|
// List<String> strTokenList = changeIntListToStringList(token);
|
|
|
|
|
|
// Storage.setStringList(saveBlueToken, strTokenList);
|
|
|
|
|
|
// // print("token:$token");
|
|
|
|
|
|
//
|
|
|
|
|
|
// int status = reply.data[46];
|
|
|
|
|
|
// // print("status:$status reply.data:${reply.data}");
|
|
|
|
|
|
//
|
|
|
|
|
|
// print("status:$status");
|
|
|
|
|
|
// switch (status) {
|
|
|
|
|
|
// case 0x00:
|
|
|
|
|
|
// //成功
|
|
|
|
|
|
// Get.log("添加用户数据解析成功");
|
|
|
|
|
|
// cancelBlueConnetctToastTimer();
|
|
|
|
|
|
// state.lockUserNo = reply.data[47];
|
|
|
|
|
|
// _updateLockUserNo();
|
|
|
|
|
|
//
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// case 0x06:
|
|
|
|
|
|
// //无权限
|
|
|
|
|
|
// Get.log("需要鉴权");
|
|
|
|
|
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
|
|
|
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
|
|
|
|
//
|
|
|
|
|
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
|
|
|
|
|
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
|
|
|
|
|
//
|
|
|
|
|
|
// IoSenderManage.senderAddUser(
|
|
|
|
|
|
// lockID: BlueManage().connectDeviceName,
|
|
|
|
|
|
// authUserID: state.senderUserId.toString(),
|
|
|
|
|
|
// keyID: state.keyInfos.value.keyId.toString(),
|
|
|
|
|
|
// userID: await Storage.getUid(),
|
|
|
|
|
|
// openMode: 1,
|
|
|
|
|
|
// keyType: 0,
|
|
|
|
|
|
// startDate: state.keyInfos.value.startDate!~/10000,
|
|
|
|
|
|
// expireDate: state.keyInfos.value.endDate!~/10000,
|
|
|
|
|
|
// role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
|
|
|
|
|
|
// password: "123456",
|
|
|
|
|
|
// needAuthor: 1,
|
|
|
|
|
|
// publicKey: publicKeyDataList,
|
|
|
|
|
|
// privateKey: getPrivateKeyList,
|
|
|
|
|
|
// token: token);
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// default:
|
|
|
|
|
|
// //失败
|
|
|
|
|
|
// Get.log("领锁失败");
|
|
|
|
|
|
//
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
2023-12-16 11:20:36 +08:00
|
|
|
|
|
2024-01-05 13:56:34 +08:00
|
|
|
|
// 添加用户(普通用户接收电子钥匙)
|
2024-04-23 15:15:56 +08:00
|
|
|
|
// Future<void> addUserConnectBlue() async {
|
|
|
|
|
|
// showBlueConnetctToastTimer(action: () {
|
|
|
|
|
|
// state.openLockBtnState.value = 0;
|
|
|
|
|
|
// eventBus.fire(RefreshLockDetailInfoDataEvent());
|
|
|
|
|
|
// });
|
|
|
|
|
|
//
|
|
|
|
|
|
// // var listData = AddUserCommand(
|
|
|
|
|
|
// // lockID: BlueManage().connectDeviceName,
|
|
|
|
|
|
// // authUserID: state.senderUserId.toString(),
|
|
|
|
|
|
// // keyID: state.keyInfos.value.keyId.toString(),
|
|
|
|
|
|
// // userID: await Storage.getUid(),
|
|
|
|
|
|
// // openMode: 1,
|
|
|
|
|
|
// // keyType: 0,
|
|
|
|
|
|
// // startDate: state.keyInfos.value.startDate!~/10000,
|
|
|
|
|
|
// // expireDate: state.keyInfos.value.endDate!~/10000,
|
|
|
|
|
|
// // role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
|
|
|
|
|
|
// // password: "123456",
|
|
|
|
|
|
// // needAuthor: 1,
|
|
|
|
|
|
// // publicKey: publicKeyDataList,
|
|
|
|
|
|
// // privateKey: getPrivateKeyList,
|
|
|
|
|
|
// // token: getTokenList).packageData();
|
|
|
|
|
|
// BlueManage().bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!, (BluetoothConnectionState deviceConnectionState) async {
|
|
|
|
|
|
// if (deviceConnectionState == BluetoothConnectionState.connected) {
|
|
|
|
|
|
// // 私钥
|
|
|
|
|
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
|
|
|
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
|
|
|
|
//
|
|
|
|
|
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
|
|
|
|
|
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
|
|
|
|
|
//
|
|
|
|
|
|
// var token = await Storage.getStringList(saveBlueToken);
|
|
|
|
|
|
// List<int> getTokenList = [0, 0, 0, 0];
|
|
|
|
|
|
// if (token != null) {
|
|
|
|
|
|
// getTokenList = changeStringListToIntList(token);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// Get.log("BlueManage().connectDeviceName:${BlueManage().connectDeviceName} authUserID:${state.senderUserId.toString()} keyID:${state.keyInfos.value.keyId.toString()} userID:${await Storage.getUid()}");
|
|
|
|
|
|
// IoSenderManage.senderAddUser(
|
|
|
|
|
|
// lockID: BlueManage().connectDeviceName,
|
|
|
|
|
|
// authUserID: state.senderUserId.toString(),
|
|
|
|
|
|
// keyID: state.keyInfos.value.keyId.toString(),
|
|
|
|
|
|
// userID: await Storage.getUid(),
|
|
|
|
|
|
// openMode: 1,
|
|
|
|
|
|
// keyType: 0,
|
|
|
|
|
|
// startDate: state.keyInfos.value.startDate!~/10000,
|
|
|
|
|
|
// expireDate: state.keyInfos.value.endDate!~/10000,
|
|
|
|
|
|
// role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
|
|
|
|
|
|
// password: "123456",
|
|
|
|
|
|
// needAuthor: 1,
|
|
|
|
|
|
// publicKey: publicKeyDataList,
|
|
|
|
|
|
// privateKey: getPrivateKeyList,
|
|
|
|
|
|
// token: getTokenList);
|
|
|
|
|
|
// } else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
|
|
|
|
|
// cancelBlueConnetctToastTimer();
|
|
|
|
|
|
// if (state.ifCurrentScreen.value == true) {
|
|
|
|
|
|
// showBlueConnetctToast();
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// state.openLockBtnState.value = 0;
|
|
|
|
|
|
// eventBus.fire(RefreshLockDetailInfoDataEvent());
|
|
|
|
|
|
// }
|
|
|
|
|
|
// });
|
|
|
|
|
|
// }
|
2024-01-05 13:56:34 +08:00
|
|
|
|
|
2023-08-24 14:25:55 +08:00
|
|
|
|
// 点击开门事件
|
2024-04-01 16:21:46 +08:00
|
|
|
|
Future<void> openDoorAction() async {
|
2024-02-28 15:27:10 +08:00
|
|
|
|
showBlueConnetctToastTimer(action: () {
|
2024-01-05 13:56:34 +08:00
|
|
|
|
state.openLockBtnState.value = 0;
|
2024-04-23 09:38:19 +08:00
|
|
|
|
// BlueManage().stopScan();
|
2024-03-12 16:19:04 +08:00
|
|
|
|
eventBus.fire(RefreshLockDetailInfoDataEvent());
|
2024-01-05 13:56:34 +08:00
|
|
|
|
});
|
2024-01-16 10:41:08 +08:00
|
|
|
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
|
|
|
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
|
|
|
|
|
|
|
|
|
|
var signKey = await Storage.getStringList(saveBlueSignKey);
|
|
|
|
|
|
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
|
|
|
|
|
|
|
|
|
|
|
var token = await Storage.getStringList(saveBlueToken);
|
|
|
|
|
|
List<int> getTokenList = changeStringListToIntList(token!);
|
|
|
|
|
|
|
2024-04-01 16:21:46 +08:00
|
|
|
|
Get.log("openMode:${state.openDoorModel}");
|
2024-04-12 18:03:40 +08:00
|
|
|
|
BlueManage().bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!, (BluetoothConnectionState deviceConnectionState) async {
|
2024-03-18 16:16:51 +08:00
|
|
|
|
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
2023-08-17 18:45:10 +08:00
|
|
|
|
IoSenderManage.senderOpenLock(
|
2023-10-13 09:30:22 +08:00
|
|
|
|
keyID: BlueManage().connectDeviceName,
|
2023-08-31 15:56:01 +08:00
|
|
|
|
userID: await Storage.getUid(),
|
2024-04-01 16:21:46 +08:00
|
|
|
|
openMode: state.openDoorModel,
|
2024-01-02 15:42:41 +08:00
|
|
|
|
openTime: DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
|
|
|
|
|
onlineToken: state.lockNetToken,
|
2023-08-17 18:45:10 +08:00
|
|
|
|
token: getTokenList,
|
|
|
|
|
|
needAuthor: 1,
|
|
|
|
|
|
signKey: signKeyDataList,
|
|
|
|
|
|
privateKey: getPrivateKeyList,
|
|
|
|
|
|
);
|
2024-03-21 11:36:48 +08:00
|
|
|
|
} else if (deviceConnectionState ==
|
|
|
|
|
|
BluetoothConnectionState.disconnected) {
|
2024-01-05 13:56:34 +08:00
|
|
|
|
cancelBlueConnetctToastTimer();
|
2024-02-28 15:27:10 +08:00
|
|
|
|
if (state.ifCurrentScreen.value == true) {
|
2024-01-04 18:27:50 +08:00
|
|
|
|
showBlueConnetctToast();
|
2024-01-05 13:56:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-04 18:27:50 +08:00
|
|
|
|
state.openLockBtnState.value = 0;
|
2024-03-12 16:19:04 +08:00
|
|
|
|
eventBus.fire(RefreshLockDetailInfoDataEvent());
|
2023-08-17 18:45:10 +08:00
|
|
|
|
}
|
2024-01-02 18:03:50 +08:00
|
|
|
|
});
|
2023-08-16 18:21:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-02-01 11:22:44 +08:00
|
|
|
|
|
2023-11-13 11:28:42 +08:00
|
|
|
|
// 查询事件记录(时间查询)
|
|
|
|
|
|
Future<void> senderReferEventRecordTime(int time) async {
|
2024-01-04 18:27:50 +08:00
|
|
|
|
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
2024-03-18 16:16:51 +08:00
|
|
|
|
(BluetoothConnectionState state) async {
|
|
|
|
|
|
if (state == BluetoothConnectionState.connected) {
|
2023-11-13 11:28:42 +08:00
|
|
|
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
|
|
|
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
|
|
|
|
|
|
|
|
|
|
var token = await Storage.getStringList(saveBlueToken);
|
|
|
|
|
|
List<int> getTokenList = changeStringListToIntList(token!);
|
|
|
|
|
|
|
|
|
|
|
|
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
|
|
|
|
|
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
|
|
|
|
|
|
|
|
|
|
|
IoSenderManage.senderReferEventRecordTimeCommand(
|
2024-01-02 15:42:41 +08:00
|
|
|
|
keyID: BlueManage().connectDeviceName,
|
|
|
|
|
|
userID: await Storage.getUid(),
|
|
|
|
|
|
logsCount: 20,
|
2023-11-13 11:28:42 +08:00
|
|
|
|
// time:DateTime.now().millisecondsSinceEpoch~/1000,
|
|
|
|
|
|
time: time,
|
2024-01-02 15:42:41 +08:00
|
|
|
|
token: getTokenList,
|
|
|
|
|
|
needAuthor: 1,
|
|
|
|
|
|
publicKey: getPublicKeyList,
|
|
|
|
|
|
privateKey: getPrivateKeyList,
|
2023-11-13 11:28:42 +08:00
|
|
|
|
);
|
|
|
|
|
|
}
|
2024-01-02 18:03:50 +08:00
|
|
|
|
});
|
2023-11-13 11:28:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-26 14:10:57 +08:00
|
|
|
|
|
2023-11-24 14:23:36 +08:00
|
|
|
|
// 获取手机联网token,根据锁设置里面获取的开锁时是否联网来判断是否调用这个接口
|
|
|
|
|
|
void getLockNetToken() async {
|
2024-04-12 18:03:40 +08:00
|
|
|
|
LockNetTokenEntity entity = await ApiRepository.to.getLockNetToken(lockId: state.keyInfos.value.lockId.toString());
|
2023-11-24 14:23:36 +08:00
|
|
|
|
if (entity.errorCode!.codeIsSuccessful) {
|
2024-04-24 17:01:59 +08:00
|
|
|
|
state.lockNetToken = entity.data!.token!.toString();
|
2024-03-23 11:23:38 +08:00
|
|
|
|
Get.log("state.lockNetToken:${state.lockNetToken}");
|
2024-04-01 16:21:46 +08:00
|
|
|
|
openDoorAction();
|
2024-04-12 18:03:40 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
showToast("获取联网token失败", something: (){
|
|
|
|
|
|
state.openLockBtnState.value = 0;
|
|
|
|
|
|
cancelBlueConnetctToastTimer();
|
|
|
|
|
|
});
|
2023-11-24 14:23:36 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-16 11:20:36 +08:00
|
|
|
|
// 普通用户接收电子钥匙之后 更新锁用户NO
|
2024-04-23 15:15:56 +08:00
|
|
|
|
// void _updateLockUserNo() async {
|
|
|
|
|
|
// LockNetTokenEntity entity = await ApiRepository.to.updateLockUserNo(
|
|
|
|
|
|
// keyId: state.keyInfos.value.keyId.toString(),
|
|
|
|
|
|
// lockUserNo: state.lockUserNo.toString()
|
|
|
|
|
|
// );
|
|
|
|
|
|
// if (entity.errorCode!.codeIsSuccessful) {
|
|
|
|
|
|
// eventBus.fire(RefreshLockDetailInfoDataEvent());
|
|
|
|
|
|
// SchedulerBinding.instance.addPostFrameCallback((_) {
|
|
|
|
|
|
// eventBus.fire(RefreshLockListInfoDataEvent());
|
|
|
|
|
|
// });
|
|
|
|
|
|
// if (state.isOpenLockNeedOnline.value == 0) {
|
|
|
|
|
|
// openDoorAction();
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// getLockNetToken();
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
2023-12-16 11:20:36 +08:00
|
|
|
|
|
2023-11-13 11:28:42 +08:00
|
|
|
|
// 查询锁记录最后时间
|
|
|
|
|
|
void getLockRecordLastUploadDataTime() async {
|
2024-02-28 15:27:10 +08:00
|
|
|
|
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to
|
|
|
|
|
|
.getLockRecordLastUploadDataTime(
|
|
|
|
|
|
lockId: state.keyInfos.value.lockId.toString());
|
2023-11-13 11:28:42 +08:00
|
|
|
|
if (entity.errorCode!.codeIsSuccessful) {
|
2024-01-02 15:42:41 +08:00
|
|
|
|
senderReferEventRecordTime(entity.data!.operateDate! ~/ 1000);
|
2023-11-13 11:28:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 操作记录上传
|
|
|
|
|
|
void lockRecordUploadData(List list) async {
|
2024-01-02 15:42:41 +08:00
|
|
|
|
KeyOperationRecordEntity entity = await ApiRepository.to
|
|
|
|
|
|
.lockRecordUploadData(
|
|
|
|
|
|
lockId: state.keyInfos.value.lockId.toString(), records: list);
|
2023-11-13 11:28:42 +08:00
|
|
|
|
if (entity.errorCode!.codeIsSuccessful) {
|
|
|
|
|
|
// mockNetworkDataRequest();
|
2024-03-28 13:46:35 +08:00
|
|
|
|
if(state.keyInfos.value.keyType == XSConstantMacro.keyTypeOnce){
|
|
|
|
|
|
// 单次删除
|
|
|
|
|
|
deletKeyData();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 普通用户或者授权管理员删除钥匙
|
|
|
|
|
|
void deletKeyData() async {
|
|
|
|
|
|
var entity = await ApiRepository.to.deleteElectronicKey(
|
|
|
|
|
|
keyId:state.keyInfos.value.keyId.toString(),
|
|
|
|
|
|
includeUnderlings: 0
|
|
|
|
|
|
);
|
|
|
|
|
|
if (entity.errorCode!.codeIsSuccessful) {
|
|
|
|
|
|
BlueManage().connectDeviceMacAddress = "";
|
|
|
|
|
|
SchedulerBinding.instance.addPostFrameCallback((_) {
|
|
|
|
|
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
|
|
|
|
|
});
|
|
|
|
|
|
Get.back();
|
2023-11-13 11:28:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-02-28 15:27:10 +08:00
|
|
|
|
|
2023-11-24 14:23:36 +08:00
|
|
|
|
/// 锁设置里面开启关闭考勤刷新锁详情
|
2024-03-23 11:23:38 +08:00
|
|
|
|
void initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction() {
|
2023-11-24 14:23:36 +08:00
|
|
|
|
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
2024-03-23 11:28:20 +08:00
|
|
|
|
state.lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent =
|
2024-04-12 18:03:40 +08:00
|
|
|
|
eventBus.on<LockSetChangeSetRefreshLockDetailWithType>().listen((event) {
|
2024-01-02 15:42:41 +08:00
|
|
|
|
if (event.type == 0) {
|
2023-11-24 14:23:36 +08:00
|
|
|
|
// 0考勤
|
2024-01-18 11:25:56 +08:00
|
|
|
|
state.isAttendance.value = int.parse(event.setResult);
|
2024-04-12 18:03:40 +08:00
|
|
|
|
state.keyInfos.value.lockSetting!.attendance = int.parse(event.setResult);
|
2024-01-02 15:42:41 +08:00
|
|
|
|
} else if (event.type == 1) {
|
2023-11-24 14:23:36 +08:00
|
|
|
|
// 1 开锁时是否需联网
|
2024-01-18 11:25:56 +08:00
|
|
|
|
state.isOpenLockNeedOnline.value = int.parse(event.setResult);
|
2024-04-12 18:03:40 +08:00
|
|
|
|
state.keyInfos.value.lockSetting!.appUnlockOnline = int.parse(event.setResult);
|
|
|
|
|
|
state.lockNetToken = "";// 改变开锁时是否联网状态的时候清空token
|
2024-03-23 11:28:20 +08:00
|
|
|
|
Get.log(
|
2024-03-21 11:36:48 +08:00
|
|
|
|
"state.isOpenLockNeedOnline.value:${state.isOpenLockNeedOnline.value}");
|
2024-01-11 15:14:02 +08:00
|
|
|
|
} else if (event.type == 2) {
|
|
|
|
|
|
// 2 常开模式
|
2024-01-18 11:25:56 +08:00
|
|
|
|
state.isOpenPassageMode.value = int.parse(event.setResult);
|
|
|
|
|
|
state.keyInfos.value.passageMode = int.parse(event.setResult);
|
|
|
|
|
|
} else if (event.type == 3) {
|
|
|
|
|
|
// 3 修改了锁名字
|
|
|
|
|
|
state.lockAlias.value = event.setResult;
|
|
|
|
|
|
state.keyInfos.value.lockAlias = event.setResult;
|
2024-03-25 17:33:40 +08:00
|
|
|
|
Storage.setString(saveLockAlias, state.lockAlias.value);
|
2024-01-18 11:25:56 +08:00
|
|
|
|
} else if (event.type == 4) {
|
|
|
|
|
|
// 4 更新了电量
|
|
|
|
|
|
state.electricQuantity.value = int.parse(event.setResult);
|
|
|
|
|
|
state.keyInfos.value.electricQuantity = int.parse(event.setResult);
|
2024-03-23 11:23:38 +08:00
|
|
|
|
} else if (event.type == 5) {
|
2024-03-23 11:28:20 +08:00
|
|
|
|
// 5 远程开锁
|
|
|
|
|
|
state.keyInfos.value.lockSetting!.remoteUnlock =
|
|
|
|
|
|
int.parse(event.setResult);
|
2023-11-24 14:23:36 +08:00
|
|
|
|
}
|
2024-04-25 17:45:00 +08:00
|
|
|
|
CommonDataManage().currentKeyInfo = state.keyInfos.value;
|
2024-03-12 16:19:04 +08:00
|
|
|
|
eventBus.fire(RefreshLockDetailInfoDataEvent());
|
2023-11-24 14:23:36 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-03-21 11:36:48 +08:00
|
|
|
|
String getKeyStatusTextAndShow() {
|
2024-03-19 18:04:51 +08:00
|
|
|
|
String text = "";
|
2024-03-21 11:36:48 +08:00
|
|
|
|
if (state.keyInfos.value.keyStatus ==
|
|
|
|
|
|
XSConstantMacro.keyStatusWaitIneffective ||
|
2024-03-19 18:04:51 +08:00
|
|
|
|
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen ||
|
|
|
|
|
|
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired ||
|
|
|
|
|
|
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted ||
|
|
|
|
|
|
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) {
|
2024-04-07 14:03:59 +08:00
|
|
|
|
text = "${"你的钥匙".tr}${XSConstantMacro.getKeyStatusStr(state.keyInfos.value.keyStatus!)}";
|
2024-03-19 18:04:51 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
text = state.isOpenPassageMode.value == 1
|
2024-04-07 14:03:59 +08:00
|
|
|
|
? "常开模式启动!长按闭锁".tr
|
2024-03-21 11:36:48 +08:00
|
|
|
|
: TranslationLoader.lanKeys!.clickUnlockAndHoldDownClose!.tr;
|
2024-03-19 18:04:51 +08:00
|
|
|
|
}
|
|
|
|
|
|
return text;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-01-05 13:56:34 +08:00
|
|
|
|
String getCurrentFormattedTime() {
|
|
|
|
|
|
// 获取当前时间
|
|
|
|
|
|
DateTime now = DateTime.now();
|
|
|
|
|
|
// 格式化日期和时间
|
|
|
|
|
|
String formattedTime = DateFormat('MM/dd HH:mm').format(now);
|
|
|
|
|
|
return formattedTime;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-08-16 18:21:42 +08:00
|
|
|
|
@override
|
2024-04-16 17:44:38 +08:00
|
|
|
|
Future<void> onReady() async {
|
2023-08-16 18:21:42 +08:00
|
|
|
|
super.onReady();
|
2024-03-23 11:23:38 +08:00
|
|
|
|
Get.log("LockDetailPage onReady");
|
2024-04-16 17:44:38 +08:00
|
|
|
|
await PermissionDialog.request(Permission.location);
|
2024-04-18 17:41:14 +08:00
|
|
|
|
await PermissionDialog.requestBluetooth();
|
2023-08-16 18:21:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
void onInit() {
|
|
|
|
|
|
super.onInit();
|
2024-03-23 11:23:38 +08:00
|
|
|
|
Get.log("LockDetailPage onInit");
|
2023-08-16 18:21:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-14 11:14:56 +08:00
|
|
|
|
@override
|
|
|
|
|
|
void onClose() {
|
2024-03-23 11:23:38 +08:00
|
|
|
|
super.onClose();
|
|
|
|
|
|
Get.log("LockDetailPage onClose");
|
2023-12-14 11:14:56 +08:00
|
|
|
|
}
|
2024-01-02 15:42:41 +08:00
|
|
|
|
}
|