getBluetoothState method

Future<BluetoothState> getBluetoothState()

Retrieves the current Bluetooth state.

Implementation

Future<BluetoothState> getBluetoothState() async {
  final result = await _methodChannel.invokeMapMethod<String, dynamic>('getBluetooth');
  if (result == null) {
    throw Exception('Failed to retrieve Bluetooth state.');
  }
  return BluetoothState.fromMap(result);
}