turnOnBluetooth method

Future<void> turnOnBluetooth()

Turn on Bluetooth (universal approach)

Implementation

Future<void> turnOnBluetooth() async {
  try {
    // On some platforms, we might need to request user to enable Bluetooth
    final availability = await UniversalBle.getBluetoothAvailabilityState();
    if (availability == AvailabilityState.poweredOff) {
      await UniversalBle.enableBluetooth();
    }
  } catch (e) {
    log('Failed to turn on Bluetooth: $e');
  }
}