|
|
|
@ -8,6 +8,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:get/get.dart'; |
|
|
|
import 'dart:async'; |
|
|
|
import 'package:permission_handler/permission_handler.dart'; |
|
|
|
import 'package:url_launcher/url_launcher.dart'; |
|
|
|
import '../../../routes/app_routes.dart'; |
|
|
|
import '../../../core/utils/logger.dart'; |
|
|
|
import 'dart:io'; |
|
|
|
@ -1131,8 +1132,14 @@ class PairingController extends GetxController with WidgetsBindingObserver { |
|
|
|
/// 打开蓝牙设置 - 简化版本 |
|
|
|
void _openBluetoothSettings() async { |
|
|
|
if (Platform.isIOS) { |
|
|
|
// iOS平台:直接显示用户指导对话框 |
|
|
|
_showBluetoothGuideDialog(); |
|
|
|
const url = 'App-Prefs:'; |
|
|
|
//拉起iOS系统设置app到前台,使用旧接口生效 |
|
|
|
if (await canLaunch(url)) { |
|
|
|
await launch(url); |
|
|
|
} else { |
|
|
|
// 如果无法直接打开,回退到显示指导对话框 |
|
|
|
_showBluetoothGuideDialog(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// Android平台使用原有方式 |
|
|
|
AppSettings.openAppSettings(type: AppSettingsType.bluetooth); |
|
|
|
|