Skip to content
pubscout

flutter_web_bluetooth

1.2.0, released 5 weeks ago by dropmeirl.com

A Dart library to use the Web Bluetooth API in your projects.

WASM-readyRock solid
$ flutter pub add flutter_web_bluetooth
Source repository

What it does

Allows you to connect and interact with Bluetooth Low Energy devices from the browser. It compiles on native IO projects without conditional exports, though it only works in a browser.

AI-written summary of version 1.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building a Flutter web or Dart project that needs to interact with Bluetooth devices.
  • You want to share code across native and web platforms without conditional exports for Bluetooth.

Skip it when

  • You need native Bluetooth support directly on IO platforms without a browser.
  • The target browser does not support the experimental Web Bluetooth API.

Strengths

  • Allows compiling on native platforms without throwing errors or requiring conditional exports.
  • Supports modern Dart web features like wasm builds via `dart:js_interop`.

Weaknesses

  • Does not actually function for Bluetooth operations outside of a browser.
  • Requires experimental browser flags and secure contexts (HTTPS or localhost).

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
3

Requires a secure context (HTTPS or localhost) and enabling experimental web platform features in browsers like Chrome on Linux.

final supported = FlutterWebBluetooth.instance.isBluetoothApiSupported;
final available = FlutterWebBluetooth.instance.isAvailable;

final requestOptions = RequestOptionsBuilder.acceptAllDevices(optionalServices: [
  BluetoothDefaultServiceUUIDS.deviceInformation.uuid
]);

try {
  final device = await FlutterWebBluetooth.instance.requestDevice(requestOptions);
} on UserCancelledDialogError {
  // The user cancelled the dialog
} on DeviceNotFoundError {
  // There is no device in range
}

Alternatives

Packages that do the same job and could replace flutter_web_bluetooth.

Works with

Packages commonly used together with flutter_web_bluetooth: ones it builds on, ones built on it, and its own family.