feat:增加电机功率操作成功提示、不在锁边应提示操作失败、无网络在点击时应提示网络访问失败

This commit is contained in:
liyi 2025-03-12 14:22:56 +08:00
parent 1ca854e435
commit 2fb3c7d2b5

View File

@ -30,9 +30,10 @@ class MotorPowerLogic extends BaseGetXController {
state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue =
state.motorTorsion.value;
eventBus
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
showToast('操作成功'.tr);
showToast('操作成功'.tr, something: () {
eventBus
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
});
}
}
@ -80,6 +81,7 @@ class MotorPowerLogic extends BaseGetXController {
switch (status) {
case 0x00:
//
cancelBlueConnetctToastTimer();
_setLockSetGeneralSetting();
break;
case 0x06:
@ -123,6 +125,10 @@ class MotorPowerLogic extends BaseGetXController {
// ()
Future<void> sendOpenDoorDirection() async {
showEasyLoading();
showBlueConnetctToastTimer(action: () {
dismissEasyLoading();
});
BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState connectionState) async {
if (connectionState == BluetoothConnectionState.connected) {
@ -149,6 +155,10 @@ class MotorPowerLogic extends BaseGetXController {
needAuthor: 1,
publicKey: getPublicKeyList,
privateKey: getPrivateKeyList);
} else if (connectionState == BluetoothConnectionState.disconnected) {
dismissEasyLoading();
cancelBlueConnetctToastTimer();
showBlueConnetctToast();
}
});
}