onHasPermissions method

  1. @override
  2. @mustCallSuper
Future<bool> onHasPermissions()
inherited

Callback on hasPermissions.

Can be overridden in sub-classes for device-specific permission handling.

Implementation

@override
@mustCallSuper
Future<bool> onHasPermissions() async => (Platform.isAndroid)
    ? await Permission.bluetoothConnect.isGranted &&
        await Permission.bluetoothScan.isGranted
    // : (Platform.isIOS)
    //     ? await Permission.bluetooth.isGranted
    // for some reason it seems like Permission.bluetooth.isGranted always
    // return false on iOS....?
    : true;