bluetooth_le_flutter 0.2.0
bluetooth_le_flutter: ^0.2.0 copied to clipboard
Flutter plugin that adds the Android native build for bluetooth_le (Bluetooth Low Energy / GATT). Add it to a Flutter app and use the bluetooth_le API.
bluetooth_le_flutter #
The Flutter plugin for Bluetooth Low Energy (GATT). It adds the native build
that Android and iOS need and re-exports the
bluetooth_le API, so there is no
separate Dart surface to learn.
bluetooth_le is pure Dart and works on
its own for Linux, macOS and Windows (command-line and Flutter desktop). Android
needs a JVM + Gradle build for its Kotlin BluetoothGatt + JNI bridge, which
can't ship as a Dart-only package — this plugin provides it and bundles the
native library into your app. Add this plugin to any Flutter app that targets
Android or iOS; desktop-only Flutter apps can depend on bluetooth_le
directly.
Support #
| Platform | Scan | Connect + read/write | Notifications | Manually verified |
|---|---|---|---|---|
| Android | ✅ | ✅ | ✅ | ❌ |
| iOS | ✅ | ✅ | ✅ | ❌ |
In the capability columns: ✅ supported · ⚠️ partial · ❌ not supported.
Manually verified — whether the author has exercised this backend on real hardware: ❌ = not yet hardware-verified.
⚠️ No
bluetooth_lebackend has been manually verified on real hardware yet (neither these Flutter platforms nor the core's desktop backends). Every backend is implemented but unverified — treat it all as best-effort for now. The backends will be verified on hardware over time.
(Linux, macOS and Windows are handled by the bluetooth_le core directly.)
Install #
dependencies:
bluetooth_le: ^0.2.0
bluetooth_le_flutter: ^0.2.0
Usage #
Import bluetooth_le and use it exactly as in a pure-Dart app:
import 'package:bluetooth_le/bluetooth_le.dart';
final ble = BleCentral.instance;
final hit = await ble.startScan(withServices: [Uuid.nordicUartService]).first;
final conn = await ble.connect(hit.device);
final serial = conn.asSerial();
The full API, the GATT-as-serial channel, platform setup (Android runtime
permissions, iOS Info.plist keys), logging control, and the test fake are
documented in the
bluetooth_le README. A runnable Flutter
demo is in example/.
License #
BSD 3-Clause. See LICENSE.