bluebird_web 0.4.0 copy "bluebird_web: ^0.4.0" to clipboard
bluebird_web: ^0.4.0 copied to clipboard

Platformweb

The Web implementation of bluebird, the Bluetooth Low Energy (BLE) plugin for Flutter.

bluebird_web #

The Web implementation of bluebird.

Usage #

This package is endorsed, which means you can simply use bluebird normally. This package will be automatically included in your app when you do, so you do not need to add it to your pubspec.yaml.

However, if you import this package to use any of its APIs directly, you should add it to your pubspec.yaml as usual.

Web Bluetooth limitations #

This implementation is backed by the browser's Web Bluetooth API, which is deliberately restricted for security and privacy reasons. Several capabilities available on native platforms are simply not exposed by the browser and therefore throw UnimplementedError here: read RSSI, request/observe MTU, bonding (create/remove/query bond), PHY (get/set/support), clear GATT cache, enumerate system or bonded devices, get the adapter name, and turn the adapter on/off.

Scanning is a device chooser, not a passive scan #

Web Bluetooth has no passive scan. There is no way to observe advertisements from arbitrary nearby devices. The only entry point, navigator.bluetooth.requestDevice(...), opens a browser-controlled chooser and returns exactly one device that the user picks.

As a consequence:

  • startScan opens the chooser (using the scan filters — services and names — and webOptionalServices) and, once the user picks a device, emits a single scan advertisement for that one device.
  • The advertisement is minimal: the browser exposes almost no advertising data, so rssi is reported as 0 and the service/manufacturer-data maps are empty.
  • If the user dismisses the chooser, a scan-failed event is emitted instead.
  • stopScan is a no-op — the chooser is modal and there is no ongoing scan.

Adapter state #

isSupported uses navigator.bluetooth.getAvailability(). getAdapterState reports on when Bluetooth is available and unavailable otherwise; finer states (off/turning-on/etc.) are not observable from the web.

0
likes
140
points
322
downloads

Documentation

API reference

Publisher

verified publisherblok21.com

Weekly Downloads

The Web implementation of bluebird, the Bluetooth Low Energy (BLE) plugin for Flutter.

Repository (GitHub)
View/report issues

Topics

#bluetooth #ble #bluetooth-low-energy

License

BSD-3-Clause (license)

Dependencies

bluebird_platform_interface, flutter, flutter_web_plugins, web

More

Packages that depend on bluebird_web

Packages that implement bluebird_web