openSettingsBluetooth method
打开蓝牙设置
Implementation
@override
void openSettingsBluetooth() {
try {
// 通过 channel 调用原生打开设置方法,并传递震动时长(单位:毫秒)
methodChannel.invokeMethod('openSettingsBluetooth');
} on PlatformException catch (e) {
// 捕获异常并打印错误信息
print("Error openSettingsBluetooth: ${e.message}");
}
}