bluetooth_universal_ble (1.5.0)

Published 2026-09-26 16:18:45 +00:00 by Platform

Installation

dart pub add bluetooth_universal_ble:1.5.0 --hosted-url=

About this package

The universal_ble backend for package:bluetooth - one BleTransport covering Android, iOS, macOS, Windows, Linux and Web.

Dart.Package.Bluetooth.UniversalBle

The universal_ble backend for package:bluetooth.

package:bluetooth holds the interface and is pure Dart, so anything can depend on it. This package holds the implementation and needs Flutter, because universal_ble is a plugin. Same split as the C# side, where CSharp.Package.Bluetooth holds the abstractions and .Native, .PluginBLE and .InTheHand hold the backends. There is one backend here rather than three, because universal_ble already covers Android, iOS, macOS, Windows, Linux and Web.

Quick start

import 'package:bluetooth/bluetooth.dart';
import 'package:bluetooth_universal_ble/bluetooth_universal_ble.dart';

final BleTransport transport = LoggingBleTransport(UniversalBleTransport());

Two behaviours worth knowing

Notify, then indicate. Some characteristics only support indications, including the Fitness Machine Control Point (0x2AD9) on every trainer worth naming; subscribeNotifications throws on those. This transport tries notify, falls back to indications, and treats a characteristic that refuses both as a sensor that will not report rather than as an error to crash on.

A write waits for its own subscription. subscribe returns its stream immediately while the platform call is still in flight, so a command written straight after could reach the device before the subscription carrying its reply existed. Writes wait on that device's pending subscription first.

CI

Publishing needs the Flutter SDK, so the job runs in ghcr.io/cirruslabs/flutter:stable and checks out with git rather than actions/checkout (that image carries no Node, which a JavaScript action needs), then uses the shared flutter-publish action.

Details
Pub
2026-09-26 16:18:45 +00:00
244
17 KiB
Assets (1)
1.5.0.tar.gz 17 KiB
Versions (10) View all
1.6.0 2026-10-01
1.5.0 2026-09-26
1.4.0 2026-09-22
1.3.0 2026-09-22
1.2.2 2026-09-22