onRequestPermissions method

  1. @override
  2. @mustCallSuper
Future<void> onRequestPermissions()
override

Callback on requestPermissions.

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

Implementation

@override
@mustCallSuper
Future<void> onRequestPermissions() async {
  if (Platform.isAndroid) {
    await Permission.bluetoothScan.request();
    await Permission.bluetoothConnect.request();
  }
  if (Platform.isIOS) {
    await Permission.bluetooth.request();
  }
}