1.更新眠花糖ios控制页空白 2.修复ios首页第一次点击控制无效果 3.修复ios扫描蓝牙的错误提示
This commit is contained in:
@@ -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 {
|
||||
// 先显示权限说明弹窗(同屏显示)
|
||||
|
||||
Reference in New Issue
Block a user