setBluetoothEnabled method

Future<void> setBluetoothEnabled(
  1. bool enabled
)

Enables or disables Bluetooth.

Implementation

Future<void> setBluetoothEnabled(bool enabled) async {
  try {
    await _methodChannel.invokeMethod('setBluetooth', {'enabled': enabled});
  } catch (e) {
    throw Exception('Error setting Bluetooth state: $e');
  }
}