disconnect method

  1. @override
Future<bool> disconnect()
override

Disconnect from a Bluetooth device. Throw BTException if failed.

Implementation

@override
Future<bool> disconnect() async {
  try {
    Map<String, dynamic> args = {"isBLE": _isBLE};
    return await methodChannel.invokeMethod("disconnect", args);
  } on PlatformException catch (e) {
    throw BTException.fromPlatform(e);
  }
}