AndroidOptions class

Scan models Android options to scan devices requestLocationPermission is used to request location permission on Android 12+ (API 31+). scanMode is used to set the scan mode for Bluetooth LE scan. Set reportDelayMillis timestamp for Bluetooth LE scan. If set to 0, you will be notified of scan results immediately. If > 0, scan results are queued up and delivered after the requested delay or 5000 milliseconds (whichever is higher). Note scan results may be delivered sooner if the internal buffers fill up. callbackType, matchMode, and numOfMatches map directly to the equivalent android.bluetooth.le.ScanSettings setters. When null, the plugin leaves them at the platform default — set them only if you need to override platform-side advert de-duplication (e.g. on Pixel hardware where the default settings throttle advertisements compared with nRF Connect).

callbackType is a list because Android's setCallbackType accepts any bitwise combination of AndroidScanCallbackType values (for example [firstMatch, matchLost] to be notified once on entry and again on exit). The plugin OR-folds the list before calling the native API. Values that require a newer API than the device supports are silently dropped (and logged); see the AndroidScanCallbackType doc for per-value API levels.

See https://developer.android.com/reference/android/bluetooth/le/ScanSettings

Constructors

AndroidOptions({bool? requestLocationPermission, AndroidScanMode? scanMode, int? reportDelayMillis, List<AndroidScanCallbackType>? callbackType, AndroidScanMatchMode? matchMode, AndroidScanNumOfMatches? numOfMatches})

Properties

callbackType List<AndroidScanCallbackType>?
getter/setter pair
hashCode int
The hash code for this object.
no setteroverride
matchMode AndroidScanMatchMode?
getter/setter pair
numOfMatches AndroidScanNumOfMatches?
getter/setter pair
reportDelayMillis int?
getter/setter pair
requestLocationPermission bool?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scanMode AndroidScanMode?
getter/setter pair

Methods

encode() Object
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

decode(Object result) AndroidOptions