pauldemarco/flutter_blue
56.2
Adequate · 23 September 2026
2.6k
lines of production code
Objective-C
with Dart, Java
5
measurements over time
What this system is
This system is a cross-platform Flutter plugin for Bluetooth Low Energy (BLE) communication, providing a unified API to scan for, connect to, and interact with BLE devices. It exposes structured models for devices, services, and characteristics, enabling read/write operations and notification subscriptions across Android, iOS, and macOS. The codebase has been modernized to support null safety and leverages Protocol Buffers for cross-platform data structures.
How it got here
2017 — null safety and protobuf migration
18 changes.
The project underwent a major architectural overhaul to support Dart null safety and modernize its internal structure. This involved migrating to a protobuf-based data model, removing obsolete abstraction layers, and updating platform-specific implementations for Android and iOS.
2018–2020 — macOS support and Android v2 embedding
4 changes.
This period focused on expanding platform support by adding a complete macOS implementation for the Flutter Blue plugin. Concurrently, the Android build system was upgraded to Gradle 6.7, and the Android implementation was refactored to support the v2 embedding, improving compatibility with newer Android and Flutter versions.
Features
Added macOS platform support for the Flutter Blue plugin
The example app now includes a complete macOS implementation, featuring the necessary Xcode project files, Swift entry points (AppDelegate, MainFlutterWindow), and configuration files to build and run the app on macOS. The macOS-specific plugin code for Flutter Blue is provided via symlinks to the existing iOS implementation, enabling Bluetooth Low Energy functionality on Apple's desktop operating system.
example/macos, macos · high confidence
Introduce protobuf schema for cross-platform Bluetooth data structures
A new protobuf definition (flutterblue.proto) is added to the protos directory, establishing a shared data model for Bluetooth operations. This schema defines message types for device states, advertisement data (including manufacturer and service data), scan results, and detailed service/characteristic/descriptor structures. It also introduces request and response messages for reading, writing, and setting notifications on characteristics and descriptors, as well as a regeneration guide for the generated Dart and Objective-C code.
protos · high confidence
Introduce structured Bluetooth device, service, and characteristic models
Added new model classes for BluetoothDevice, BluetoothService, BluetoothCharacteristic, and BluetoothDescriptor in lib/src, providing structured access to device state, service discovery, and characteristic/descriptor read, write, and notification capabilities. The FlutterBlue API now exposes these objects to represent connected devices, their services, and their characteristics/descriptors, enabling more robust interaction with Bluetooth peripherals.
lib/src · high confidence
Removals
Removed obsolete Bluetooth LE abstraction contracts
The legacy interface definitions for Bluetooth LE components—including \IAdapter\, \IDevice\, \IService\, \ICharacteristic\, and \IDescriptor\—have been removed from the \lib/abstractions/contracts\ directory. This cleanup eliminates unused or outdated API contracts that were no longer aligned with the current platform channel implementation.
lib/abstractions/contracts · high confidence
Removed obsolete Bluetooth abstraction and stream files
Deleted a large number of obsolete files from the \lib/abstractions\ and \lib/streams\ directories, including \advertisement\_record.dart\, \characteristic\_prop\_type.dart\, \known\_characteristics.dart\, \native\_methods.dart\, and various stream handlers. This cleanup removes unused or deprecated types and platform channel wrappers that are no longer needed for the current implementation.
lib/abstractions · high confidence
Architecture
Refactored Flutter Blue library structure and added licensing
The library's internal structure has been refactored, moving from a single-file implementation to a modular structure with separate parts for Bluetooth characteristics, descriptors, devices, and services. A copyright header and BSD-style license header have been added to the main library file. Additionally, several new dependencies (collection, convert, rxdart, protobuf) and imports have been introduced to support the new structure.
lib · high confidence
Behavioural changes
Implemented core Bluetooth LE operations on iOS
The iOS plugin now supports a comprehensive set of Bluetooth LE operations, including scanning, connecting, disconnecting, discovering services, and reading/writing characteristics and descriptors. The implementation replaces the previous event channel approach with a method channel interface, adding support for macOS, log level configuration, and duplicate scan options.
ios/Classes · high confidence
Migrate to null safety and update project structure
The plugin has been migrated to support Dart null safety, a significant update for developers to ensure type safety and modern Dart features. Additionally, the project's IDE configuration files have been updated: the \flutter\_blue\_android.iml\ file was removed, the \flutter\_blue.iml\ file was simplified to a standard Java module type, and the \.gitignore\ file was updated to include \.dart\_tool/\ and \.vscode/\ while removing outdated exclusions. The \README.md\ was also updated with comprehensive usage examples and API reference tables.
(repo-wide) · high confidence
Redesigned example app with new widget hierarchy and device management
The example app's UI was completely restructured. The previous \ScanDevicesPage\, \MonitorStatePage\, and \DeviceTile\ components were removed and replaced with a new \widgets.dart\ module containing \ScanResultTile\, \ServiceTile\, and \CharacteristicTile\ widgets. The main entry point (\main.dart\) was updated to use a \BluetoothOffScreen\ state for when Bluetooth is off, and a \FindDevicesScreen\ that lists connected devices and scan results using \StreamBuilder\ for reactive updates. The app now supports connecting to devices, viewing service/characteristic details, and performing read/write operations directly from the example.
example/lib · high confidence
Refactor Bluetooth advertisement parsing and support Android v2 embedding
The plugin now uses a new \AdvertisementParser\ class to parse raw Bluetooth advertisement data into structured \AdvertisementData\ protos, improving how scan results and device information are processed. Additionally, the Android implementation has been updated to support the v2 Android embedding, allowing the plugin to function correctly on newer Android versions and Flutter versions.
_android/src/main/java/com/pauldemarco/flutter\blue · high confidence
Removed legacy Android platform classes
The Android source files for the plugin's internal abstraction layer have been removed. Specifically, the Adapter, AdvertisementRecord, BluetoothLE, BluetoothState, ChannelMap, Characteristic, CharacteristicPropertyType, CharacteristicWriteType, Descriptor, Device, DeviceState, FlutterBluePlugin, Guid, and Service classes have all been deleted from the android/src/main/java/com/pauldemarco/flutterblue directory. This indicates a significant internal refactoring or migration of the Android implementation, likely to a new architecture or library.
android/src/main/java/com/pauldemarco/flutterblue · high confidence
Removed obsolete concrete implementation files
The \lib/concrete\ directory has been cleared of obsolete files, including the old implementations for \Adapter\, \BluetoothLE\, \Characteristic\, \Descriptor\, \Device\, and \Service\, as well as associated event channels and utility classes like \Guid\ and \Lerp\. This cleanup removes unused or deprecated code from the library.
lib/concrete · high confidence
Updated Android example app for Flutter v2 embedding
The Android example app was updated to support the v2 Android embedding, which is required for modern Flutter versions. This includes adding the \EmbeddingV1Activity\ class for backward compatibility, configuring the \NormalTheme\ and \SplashScreenDrawable\ metadata in the manifest, and updating the \MainActivity\ to extend \FlutterActivity\ instead of \FlutterActivity\ with the old plugin registration pattern. Users running the example on newer Android/Flutter versions will see the app launch correctly with proper theming and hot reload support.
example/android · high confidence
Updated example project configuration and tooling files
The example project's IDE and build configuration files have been updated to align with modern Flutter tooling standards. The project now includes a \.metadata\ file to track the Flutter revision and channel, while legacy \.iml\ files have been removed or refactored to use the \JAVA\_MODULE\ type with updated source and library entries. Additionally, the \.gitignore\ file has been expanded to exclude new build and cache directories, and the \README.md\ has been updated with current Flutter documentation links.
example · high confidence
Updated iOS build configuration and project files
The iOS example project's build configuration has been updated to include CocoaPods support via new include statements in Debug.xcconfig and Release.xcconfig. Additionally, the AppFrameworkInfo.plist was updated to use a variable for the development language and removed the explicit arm64 device capability requirement.
example/ios/Flutter · medium confidence
Updated protobuf generated code to latest version
The generated Dart code for the \flutterblue.proto\ schema has been regenerated using the latest \protobuf\ package (version ^0.9.0+1). This update ensures compatibility with the current protobuf library and includes all message and enum definitions (such as \BluetoothState\, \AdvertisementData\, and \ScanResult\) as defined in the proto file.
lib/gen · high confidence
Upgraded Gradle wrapper to version 6.7
The Android build system now uses Gradle 6.7, as specified in the gradle-wrapper.properties file. This update ensures the project uses a specific, stable version of the Gradle build tool, which may bring performance improvements, bug fixes, and compatibility updates for the Android build process.
android/gradle · high confidence
iOS build system updated to support CocoaPods and modern Xcode configurations
The iOS example project has been updated to use CocoaPods for dependency management, introducing a Pods group and associated build phases to embed pod frameworks. The project now includes build scripts to check the Pods manifest lock and embed pods, replacing older resource and framework references. Additionally, the Xcode project file and scheme have been upgraded to support a 'Profile' build configuration and reflect an Xcode version bump to 1020.
example/ios/Runner.xcodeproj · high confidence
iOS example app updated with modern launch screen and Bluetooth permissions
The iOS example project now uses a modern launch screen (LaunchScreen.storyboard) that displays the app's launch image, replacing the previous static background. The app's versioning is now driven by Flutter build variables (FLUTTER\_BUILD\_NAME, FLUTTER\_BUILD\_NUMBER) and development language settings. Additionally, Bluetooth usage descriptions (NSBluetoothAlwaysUsageDescription, NSBluetoothPeripheralUsageDescription) have been added to Info.plist to support Bluetooth functionality.
example/ios/Runner · high confidence
Test coverage
Added initial widget test for the example app; Updated and expanded Guid unit tests.
Dependencies
Upgrade to Dart 2.12+ and Flutter 1.12.13+ with new dependencies
The plugin now requires Dart 2.12.0+ and Flutter 1.12.13+ to support null safety. Dependencies have been updated to \protobuf ^2.0.0\, \rxdart ^0.26.0\, \collection ^1.15.0\, and \meta ^1.3.0\. The example app's \pubspec.yaml\ has been simplified, removing unnecessary dependencies like \convert\ and \flutter\_test\ from the main dependencies list, and adding \publish\_to: 'none'\ to prevent accidental publishing. Android build files were updated to use Gradle 4.1.0, AndroidX, and target SDK 30, while iOS and macOS podspecs were updated to use Protobuf \~\> 3.11.4.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Score
- CAI 49 → 56 (+6.8)
- Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 100 → 92 (-8.1)
- Architecture 100 → 100 (+0.0)
- Maturity 37 → 49 (+12.3)
- Readiness 26 → 36 (+10.3)
- Security 100 → 100 (+0.0)
- Domain Modelling 100 → 100 (+0.0)
Resolved (7)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- No exposed public API
- Test reliability not included
- The Usage section clips mid-connect-to-a-device code, and the outline lists Discover services, Read/write characteristics, Read/write descriptors, Set notifications/listen to changes, Read MTU, request larger size, plus Android/iOS/Reference sections. (README.md)
- complexity unreadable for .dart, .java, .swift — churn × complexity hotspots could not be measured
- dormant codebase — no living knowledge left to concentrate
New (14)
- AdvertisementParser.parse (cognitive 32) (android/src/main/java/com/pauldemarco/flutter_blue/AdvertisementParser.java)
- AdvertisementParser.parse (cyclomatic 19) (android/src/main/java/com/pauldemarco/flutter_blue/AdvertisementParser.java)
- ClassTooLong: FlutterBluePlugin (android/src/main/java/com/pauldemarco/flutter_blue/FlutterBluePlugin.java)
- Dependency hygiene PARTLY measured — Maven/Gradle declarations read, no dependency graph resolved
- Documentation: no architecture or design documentation (README.md)
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (13–14 lines × 2) (example/lib/widgets.dart)
- FileTooLong: flutter_blue/FlutterBluePlugin.java (android/src/main/java/com/pauldemarco/flutter_blue/FlutterBluePlugin.java)
- FlutterBluePlugin.onMethodCall (cognitive 114) (android/src/main/java/com/pauldemarco/flutter_blue/FlutterBluePlugin.java)
- FlutterBluePlugin.onMethodCall (cyclomatic 74) (android/src/main/java/com/pauldemarco/flutter_blue/FlutterBluePlugin.java)
- MethodTooLong: FlutterBluePlugin.onMethodCall (android/src/main/java/com/pauldemarco/flutter_blue/FlutterBluePlugin.java)
- ProtoMaker.from (cognitive 16) (android/src/main/java/com/pauldemarco/flutter_blue/ProtoMaker.java)
- TodoComment (example/test/widget_test.dart)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
pauldemarco/flutter_blue was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 23 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 7c7a86c95a3a2537bfb7e3c368716cdb26cf66b0 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-955b9cee9818.