|
@@ -4,7 +4,7 @@ class BluetoothUtils {
|
|
|
static const mChannel = const MethodChannel('io.fivefire/method_channel');
|
|
static const mChannel = const MethodChannel('io.fivefire/method_channel');
|
|
|
static const eChannel = const EventChannel("io.fivefire/event_channel");
|
|
static const eChannel = const EventChannel("io.fivefire/event_channel");
|
|
|
|
|
|
|
|
- Future<bool> isBTDevice() async {//检查是否有蓝牙设备
|
|
|
|
|
|
|
+ Future<bool> isBTDevice() async {//检查本机是否有蓝牙设备
|
|
|
try {
|
|
try {
|
|
|
return await mChannel.invokeMethod('isBTDevice');
|
|
return await mChannel.invokeMethod('isBTDevice');
|
|
|
} on PlatformException catch (e) {
|
|
} on PlatformException catch (e) {
|
|
@@ -22,7 +22,7 @@ class BluetoothUtils {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Future scanBT() async {
|
|
|
|
|
|
|
+ Future scanBT() async {//开始搜索蓝牙设备
|
|
|
try {
|
|
try {
|
|
|
return await mChannel.invokeMethod('scanBT');
|
|
return await mChannel.invokeMethod('scanBT');
|
|
|
} on PlatformException catch (e) {
|
|
} on PlatformException catch (e) {
|