FlutterWebBluetoothInterface class abstract

An interface for FlutterWebBluetooth to make sure that both the unsupported and web version have the same api.

See: FlutterWebBluetooth.

Implementers

Constructors

FlutterWebBluetoothInterface()
An interface for FlutterWebBluetooth to make sure that both the unsupported and web version have the same api.

Properties

advertisements Stream<AdvertisementReceivedEvent<AdvertisementBluetoothDevice>>
the advertisements stream emits AdvertisementReceivedEvents for devices found through requestLEScan.
no setter
defaultAdvertisementsMemory bool
This is a setting for (new) devices if it should use memory for advertisements.
getter/setter pair
devices Stream<Set<BluetoothDevice>>
Get a Stream with a Set of all devices paired in this browser session. If the browser supports Bluetooth.getDevices, which none currently do unless a flag is used, then it will also return a list of all paired devices.
no setter
hashCode int
The hash code for this object.
no setterinherited
hasRequestLEScan bool
Check to see if the current browser has the requestLEScan method.
no setter
isAvailable Stream<bool>
Get a Stream for the availability of a Bluetooth adapter.
no setter
isBluetoothApiSupported bool
Get if the bluetooth api is available in this browser. This will only check if the api is in the navigator. Not if anything is available. This will return false if the website is not loaded in a secure context.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestAdvertisementDevice(AdvertisementBluetoothDevice device, {List<String> requiredServices = const [], List<String> optionalServices = const []}) Future<BluetoothDevice>
The advertisements stream emits an event with a AdvertisementBluetoothDevice. This device doesn't have a gatt server and can thus not do everything you may want.
requestDevice(RequestOptionsBuilder options) Future<BluetoothDevice>
Request a WebBluetoothDevice from the browser (user). This will resolve into a single device even if the filter options (and environment) have multiple devices that fit that could be found.
requestLEScan(LEScanOptionsBuilder options) Future<BluetoothLEScan>
Request the user to start scanning for Bluetooth LE devices in the area. Not every browser supports this method yet so check it using hasRequestLEScan. However even if the browser supports it, the Future may never complete on browsers. This has been the case for Chrome on linux and windows even with the correct flag enabled. Chrome on Android does seem to work. Add a Future.timeout to combat this.
toString() String
A string representation of this object.
inherited

Operators

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