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

@@ -238,24 +238,28 @@ Future<Map> checkBlueToothPermissin() async {
var locationGranted;
if (Platform.isIOS) {
PermissionStatus isBleGranted = await Permission.bluetooth.request();
if (!isBleGranted.isGranted) {
// startBluetoothScanning();
await FlutterBluePlus.startScan(timeout: Duration(seconds: 10));
data = {
'bluetoothScanGranted': true,
'bluetoothConnectGranted': true,
};
} else {
try {
try {
PermissionStatus isBleGranted = await Permission.bluetooth.request();
if (!isBleGranted.isGranted) {
// startBluetoothScanning();
await FlutterBluePlus.startScan(timeout: Duration(seconds: 10));
} catch (e) {
TopSlideNotification.show(Get.context!,
text: "蓝牙权限未开启,请在设置中开启蓝牙权限".tr,
textColor: themeController.currentColor.sc9);
data = {
'bluetoothScanGranted': true,
'bluetoothConnectGranted': true,
};
} else {
try {
await FlutterBluePlus.startScan(timeout: Duration(seconds: 10));
} catch (e) {
TopSlideNotification.show(Get.context!,
text: "蓝牙权限未开启,请在设置中开启蓝牙权限".tr,
textColor: themeController.currentColor.sc9);
}
}
return data;
} catch (e) {
ef.log("${e.toString()}");
}
return data;
} else {
try {
// 先显示权限说明弹窗(同屏显示)