setOptions static method

Future<void> setOptions({
  1. bool showPowerAlert = true,
  2. bool restoreState = false,
})

Set configurable options

  • showPowerAlert Whether to show the power alert (iOS & MacOS only). i.e. CBCentralManagerOptionShowPowerAlertKey To set this option you must call this method before any other method in this package. See: https://developer.apple.com/documentation/corebluetooth/cbcentralmanageroptionshowpoweralertkey This option has no effect on Android.
  • restoreState Whether to opt into state restoration (iOS & MacOS only). i.e. CBCentralManagerOptionRestoreIdentifierKey To set this option you must call this method before any other method in this package. See Apple Documentation for more details. This option has no effect on Android.

Implementation

static Future<void> setOptions({
  bool showPowerAlert = true,
  bool restoreState = false,
}) async {
  await _invokePlatform(() => FlutterBluePlusPlatform.instance
      .setOptions(BmSetOptionsRequest(showPowerAlert: showPowerAlert, restoreState: restoreState)));
}