1.更新眠花糖ios控制页空白 2.修复ios首页第一次点击控制无效果 3.修复ios扫描蓝牙的错误提示

This commit is contained in:
2026-04-03 15:07:25 +08:00
parent bdeef22130
commit ca00faad0b
4 changed files with 195 additions and 206 deletions

View File

@@ -63,18 +63,22 @@ class _MHTBlueteethDevicePageState extends State<MHTBlueteethDevicePage> {
mhtBlueToothController.startStatusPolling();
mhtBlueToothController.search.value = "";
mhtBlueToothController.currentDeviceMac?.value = "";
BluetoothHelper.listenBluetoothState((isOn) {
BluetoothHelper.listenBluetoothState((isOn) async {
mhtBlueToothController.model.bluetooth = isOn;
mhtBlueToothController.updateAll();
if (!isOn && !_isDialogShowing) {
_isDialogShowing = true;
mhtBlueToothController.model.blueRawData = [];
mhtBlueToothController.model.deviceDataStatus = [];
mhtBlueToothController.updateAll();
_showBluetoothNotEnabledDialog().then((_) {
_isDialogShowing = false;
});
await Future.delayed(Duration(seconds: 2));
bool isReallyOn = await FlutterBluePlus.isOn;
if (!isReallyOn) {
_isDialogShowing = true;
mhtBlueToothController.model.blueRawData = [];
mhtBlueToothController.model.deviceDataStatus = [];
mhtBlueToothController.updateAll();
_showBluetoothNotEnabledDialog().then((_) {
_isDialogShowing = false;
});
}
}
});
}