修复首次添加完锁之后,iOS系统开锁提示锁已被重置问题
This commit is contained in:
parent
1aa818402b
commit
696a2884d2
@ -470,10 +470,10 @@ abstract class Routers {
|
||||
static const String addIrisTypeManagePage = '/AddIrisTypeManagePage'; // 添加虹膜
|
||||
static const String addIrisPage = '/AddIrisPage'; // 添加虹膜过程
|
||||
|
||||
static const String palmListPage = '/PalmListPage'; // 手掌列表
|
||||
static const String addPalmTypePage = '/AddPalmTypePage'; // 添加手掌
|
||||
static const String addPalmPage = '/AddPalmPage'; // 添加手掌过程
|
||||
static const String palmDetailPage = '/PalmDetailPage'; // 手掌详情
|
||||
static const String palmListPage = '/PalmListPage'; // 掌静脉列表
|
||||
static const String addPalmTypePage = '/AddPalmTypePage'; // 添加掌静脉
|
||||
static const String addPalmPage = '/AddPalmPage'; // 添加掌静脉过程
|
||||
static const String palmDetailPage = '/PalmDetailPage'; // 掌静脉详情
|
||||
|
||||
static const String passwordKeyDetailChangeDatePage =
|
||||
'/passwordKeyDetailChangeDatePage'; //密码更改时间
|
||||
|
||||
@ -285,8 +285,7 @@ class BlueManage {
|
||||
{bool isAddEquipment = false}) async {
|
||||
FlutterBluePlus.isSupported.then((bool isAvailable) async {
|
||||
if (isAvailable) {
|
||||
AppLog.log(
|
||||
'蓝牙状态 系统蓝牙状态:$_adapterState 蓝牙连接状态:$bluetoothConnectionState');
|
||||
// AppLog.log('蓝牙状态 系统蓝牙状态:$_adapterState 蓝牙连接状态:$bluetoothConnectionState');
|
||||
if (_adapterState == BluetoothAdapterState.on) {
|
||||
// 蓝牙已开启,可以进行蓝牙操作
|
||||
if (bluetoothConnectionState != BluetoothConnectionState.connected) {
|
||||
@ -336,11 +335,13 @@ class BlueManage {
|
||||
});
|
||||
} else if (isAddEquipment == false && isExistDevice == false) {
|
||||
//取消缓存直接使用,存在配对场景设备信息会更变
|
||||
// AppLog.log('无存在设备需要扫描 deviceName:$deviceName isAddEquipment:$isAddEquipment');
|
||||
startScanSingle(deviceName, 15, (List<ScanResult> scanDevices) {
|
||||
_connectDevice(scanDevices, deviceName, connectStateCallBack,
|
||||
isAddEquipment: isAddEquipment);
|
||||
});
|
||||
} else {
|
||||
// AppLog.log('安卓或者iOS 存在设备不需要扫描 deviceName:$deviceName isAddEquipment:$isAddEquipment');
|
||||
_connectDevice(devicesList, deviceName, connectStateCallBack,
|
||||
isAddEquipment: isAddEquipment);
|
||||
}
|
||||
@ -372,8 +373,8 @@ class BlueManage {
|
||||
: devicesList[knownDeviceIndex].device.platformName;
|
||||
|
||||
bluetoothConnectDevice = devicesList[knownDeviceIndex].device;
|
||||
// AppLog.log('bluetoothConnectDevice: $bluetoothConnectDevice');
|
||||
scanResult = devicesList[knownDeviceIndex];
|
||||
// AppLog.log('bluetoothConnectDevice: $bluetoothConnectDevice scanResult:$scanResult');
|
||||
|
||||
_initGetMtuSubscription();
|
||||
_initListenConnectionState();
|
||||
@ -381,7 +382,7 @@ class BlueManage {
|
||||
if (scanResult == null || connectDeviceMacAddress.isEmpty) {
|
||||
return;
|
||||
}
|
||||
// AppLog.log("调用了停止扫描的方法");
|
||||
AppLog.log('调用了停止扫描的方法');
|
||||
await stopScan();
|
||||
|
||||
if ((scanResult.advertisementData.serviceUuids[0].toString()[31] == '0') &&
|
||||
@ -389,6 +390,11 @@ class BlueManage {
|
||||
connectStateCallBack(BluetoothConnectionState.disconnected);
|
||||
EasyLoading.showToast('该锁已被重置'.tr, duration: 2000.milliseconds);
|
||||
scanDevices.clear();
|
||||
|
||||
startScanSingle(deviceName, 15, (List<ScanResult> scanDevices) {
|
||||
_connectDevice(scanDevices, deviceName, connectStateCallBack,
|
||||
isAddEquipment: isAddEquipment);
|
||||
});
|
||||
return;
|
||||
}
|
||||
//尝试连接设备
|
||||
|
||||
@ -1125,7 +1125,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
if (state.keyInfos.value.lockFeature!.palmVein == 1) {
|
||||
showWidgetArr.add(
|
||||
bottomItem(
|
||||
'images/main/icon_palm.png', '手掌'.tr, state.bottomBtnisEable.value,
|
||||
'images/main/icon_palm.png', '掌静脉'.tr, state.bottomBtnisEable.value,
|
||||
() {
|
||||
Get.toNamed(Routers.palmListPage, arguments: <String, int?>{
|
||||
'lockId': state.keyInfos.value.lockId,
|
||||
|
||||
@ -469,7 +469,9 @@ class SaveLockLogic extends BaseGetXController {
|
||||
void backAction() {
|
||||
eventBus.fire(RefreshLockListInfoDataEvent(clearScanDevices: true));
|
||||
BlueManage().disconnect();
|
||||
Get.close(state.isFromMap == 1 ? (CommonDataManage().seletLockType == 0 ? 4 : 5) : (CommonDataManage().seletLockType == 0 ? 5 : 6));
|
||||
Future<void>.delayed(const Duration(seconds: 1), () {
|
||||
Get.close(state.isFromMap == 1 ? (CommonDataManage().seletLockType == 0 ? 4 : 5) : (CommonDataManage().seletLockType == 0 ? 5 : 6));
|
||||
});
|
||||
//刚刚配对完,需要对开锁页锁死 2 秒
|
||||
Future<void>.delayed(const Duration(milliseconds: 200), () {
|
||||
if (Get.isRegistered<LockDetailLogic>()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user