isPermissionBluetoothGranted property

Future<bool> isPermissionBluetoothGranted

Check if it is allowed on Android 12 access to Bluetooth onwards

Implementation

static Future<bool> get isPermissionBluetoothGranted async {
  //bluetooth esta disponible?
  bool bluetoothState = false;
  if (Platform.isWindows) {
    return true;
  } else if (Platform.isAndroid || Platform.isIOS) {
    try {
      bluetoothState = await _channel.invokeMethod('ispermissionbluetoothgranted');
      //print("llego: $bluetoothState");
    } on PlatformException catch (e) {
      print("Fallo Bluetooth status: '${e.message}'.");
    }
  }

  return bluetoothState;
}