stopScanning method

  1. @override
Future<void> stopScanning()
override

Implementation

@override
Future<void> stopScanning() async {
  try {
    await bltMethodChannel.invokeMethod('stopScanning');
    deviceSub?.cancel();
  } on PlatformException catch (e) {
    if (e.code == 'BluetoothException') {
      throw BluetoothException(e.message);
    }
    throw Exception(e.message);
  }
}