my_bluetooth 2.0.0
my_bluetooth: ^2.0.0 copied to clipboard
Android Classic Bluetooth discovery, RFCOMM connections, and byte or file transfer for Flutter printer and accessory apps.
Changelog #
2.0.0 #
- Adds side-effect-free
getCapabilities()andcheckPermissions()APIs plus operation-scopedrequestPermissions(BluetoothOperation)so applications can show their own rationale before Android opens a permission dialog. - Adds Scan Session V2 through
startScanSession(), with owned result/state streams, completion and stop lifecycle, RSSI, Android device class, last-seen timestamps, AND-combined filters, timeout, stale-result removal, and maximum emitted results. - Adds stable typed error categories to the new additive APIs while preserving the exception and payload behavior of retained legacy APIs.
- Adds opt-in, redacted operation diagnostics. Diagnostics are disabled by default and exclude arguments, identifiers, paths, RSSI, messages, and data.
- Serializes complete command and file operations on one native writer and binds each queued operation to its original connection generation. A stale operation cannot continue on or disconnect a replacement connection.
- Documents the Android 12+
neverForLocationassertion and the application responsibilities that apply when RSSI or scan data is used for location. - Expands automated Dart/native concurrency, lifecycle, and security validation
coverage. Retained
startScan,stopScan,connect,sendCmd, andsendFilecall sites remain source-compatible. - Requires Flutter 3.47.1, Dart 3.13.1, Android API 24, Java 17, AGP 9.1, and Gradle 9.3.1.
- Correctly declares Android-only Classic Bluetooth/RFCOMM support. iOS is not supported; the former iOS registration was a non-functional stub.
- Adds balanced Activity and broadcast-receiver lifecycle handling.
- Updates Android 12+ Nearby Devices permissions and removes the unused advertising permission.
- Serializes concurrent permission requests and completes callbacks exactly once when the Android Activity changes or the engine detaches.
- Makes
connectcomplete after the RFCOMM streams are ready and adds timeout handling on Dart. - Replaces unsafe receive parsing with bounded 34-byte frame assembly.
- Streams files in bounded chunks instead of reading the complete file into memory.
- Adds command validation, unsigned response bytes,
commandResponses, and opt-in debug logging. - Fixes scan restart, concurrent start/stop cancellation, natural-finish cleanup, combined filters, address de-duplication, stale-device removal, adapter state updates, enum lookup, equality, and parsing issues.
- Adds Dart, widget, and native Android unit tests plus complete usage, migration, operations, and security documentation.
1.0.2+3 #
- Package metadata update.
1.0.2 - 2025-01-06 #
- Updated plugin information.
1.0.1 - 2025-01-06 #
- Added plugin information.
1.0.0 - 2025-01-06 #
- Initial Android Bluetooth workflow.
0.0.1 - 2024-09-15 #
- Initial setup with Flutter 3.24.2 and Dart 3.5.2.