bluetooth_flutter

Cross-platform Bluetooth Low Energy for Flutter. Builds the native bluetooth_core (Rust / btleplug) library automatically via cargokit and re-exports the full bluetooth_dart API.

Usage

import 'package:bluetooth_flutter/bluetooth_flutter.dart';

await BluetoothFlutter.ensureInitialized();
if ((await Bluetooth.instance.requestPermission()).isUsable) {
  final scan = await Bluetooth.instance.startScan();
  scan.devices.listen((d) => debugPrint('$d'));
}

Platform setup

The plugin builds and bundles the native library for you; you still declare the Bluetooth permission in your app:

  • macOS and iOS: add NSBluetoothAlwaysUsageDescription to Info.plist. On macOS (sandboxed) also enable the com.apple.security.device.bluetooth entitlement.
  • Android: request the scan permissions at runtime before scanning: BLUETOOTH_SCAN and BLUETOOTH_CONNECT on API 31+, or ACCESS_FINE_LOCATION (with location services enabled) on API 30 and below. The plugin manifest declares all three and bundles btleplug's droidplug Java/JNI companion; the example requests them with permission_handler.

Building requires Rust (until precompiled binaries are published).

Status

Host Status
macOS Tested
Ubuntu 24.04 Tested
Android Tested
iOS Untested
iOS Simulator Untested
Android Emulator Untested
Windows 11 Untested
Web Untested

macOS, Ubuntu 24.04, and Android are tested.

Web support comes from bluetooth_dart's Web Bluetooth backend directly and does not require the Flutter plugin's native library.

Libraries

bluetooth_flutter
Flutter integration for the bluetooth_dart package.