flutter_blue
0.8.0, released 6 years ago by pauldemarco.com
Connect and communicate with Bluetooth Low Energy devices on Android and iOS.
What it does
Flutter plugin for scanning, connecting, and interacting with Bluetooth Low Energy (BLE) devices. It lets you discover services, read and write characteristics and descriptors, and listen to value changes.
AI-written summary of version 0.8.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to build a Flutter application that interacts with BLE peripherals
- You want cross-platform BLE support for Android and iOS
Skip it when
- You are looking for a stable API without breaking changes (the library is still evolving towards 1.0)
- You only need standard networking or local storage
Strengths
- Comprehensive coverage of BLE actions (scan, connect, discover services, read/write characteristics and descriptors)
- Stream-based architecture using rxdart for reactive state changes
Weaknesses
- API is subject to breaking changes as it moves toward version 1.0
- Must be tested on a real device rather than an emulator for reliable BLE testing
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 5
Requires changing minSdkVersion to 19 for Android, adding Bluetooth and Location permissions in AndroidManifest.xml, and adding Bluetooth and Location usage descriptions in Info.plist for iOS.
FlutterBlue flutterBlue = FlutterBlue.instance;
flutterBlue.startScan(timeout: Duration(seconds: 4));
var subscription = flutterBlue.scanResults.listen((results) {
for (ScanResult r in results) {
print('${r.device.name} found! rssi: ${r.rssi}');
}
});
flutterBlue.stopScan();Alternatives
Packages that do the same job and could replace flutter_blue.
- flutter_blue_plus
Flutter plugin for connecting to Bluetooth Low Energy devices.
90Compare - universal_ble
Cross-platform Bluetooth Low Energy (BLE) plugin for Flutter
92Compare - flutter_reactive_ble
Reactive BLE plugin for Android and iOS that supports multiple devices
86Compare - flutter_blue_classic
A flutter plugin for communicating with bluetooth classic devices.
67Compare
Works with
Packages commonly used together with flutter_blue: ones it builds on, ones built on it, and its own family.
- convertflutter_blue depends on itEncoders and decoders for converting between different data representations.
- rxdartflutter_blue depends on itImplementation of the ReactiveX API for asynchronous programming leveraging native Dart Streams.
- protobufflutter_blue depends on itProvides runtime support for Dart protocol buffer messages generated by protoc_plugin.