flutter_web_bluetooth
A library to use the web bluetooth api in your web project. Will play nice if used in IO projects.
1.1.0
42K downloads/mo
#1588 most downloaded on pub.dev
jeroen1602/flutter_web_bluetooth
What this package is like to depend on
Last release 1 years ago
04 Jun 2025
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 19 of 19 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
19 releases · first in 2021
0 releases in the last 12 months
see the full history below
Release timeline
19 releases · May 2021 to Jun 2025Releases
latest 19-
1.1.004 Jun 2025Release notes
Open source →- Breaking-ish Requesting devices or scans now no longer checks if a bluetooth device is available.
The browser will return aDeviceNotFoundErrorif the bluetooth adapter was unavailable while a scan was requested.- If you want the old behaviour then set
checkingAvailabilitytotrueforrequestDevice,
requestAdvertisementDevice, and/ orrequestLEScan.
- If you want the old behaviour then set
- You can now call
getAvailabilityto get a (new)Futurethat will check if there is currently a bluetooth adapter
available. - Updated list of manufacturer identifiers
Release notes
Open source →- Breaking-ish Requesting devices or scans now no longer checks if a bluetooth device is available.
The browser will return a
DeviceNotFoundErrorif the bluetooth adapter was unavailable while a scan was requested.- If you want the old behaviour then set
checkingAvailabilitytotrueforrequestDevice,requestAdvertisementDevice, and/ orrequestLEScan.
- If you want the old behaviour then set
- You can now call
getAvailabilityto get a (new)Futurethat will check if there is currently a bluetooth adapter available. - Updated list of manufacturer identifiers
- Breaking-ish Requesting devices or scans now no longer checks if a bluetooth device is available.
-
1.0.022 Nov 2024Release notes
Open source →- Changed from
dart:htmltodart:js_interopto support wasm builds. - Dependencies:
- Bluetooth advertisements
- Breaking:
src/AdvertisementReceivedEventno longer extendsweb/AdvertisementReceivedEventInterface src/AdvertisementReceivedEventnow has awithMemoryconstructor- Breaking:
web/AdvertisementReceivedEventInterfaceno longer exists - Breaking:
web/WebAdvertisementReceivedEventhas been renamed toweb/BluetoothAdvertisementReceivedEvent - Breaking:
web/WebAdvertisementReceivedEvent.fromJSObjectconstructor no longer exists - Breaking:
web/WebAdvertisementReceivedEvent.withMemoryconstructor no longer exists
- Breaking:
- Bluetooth filters:
web/BluetoothScanFilterHelperis now deprecated. Useweb/BluetoothManufacturerDataFilter.create(),
web/BluetoothServiceDataFilter.create(), andweb/BluetoothScanFilter.create()instead.- Breaking:
web/BluetoothServiceDataFilternow requires a service UUID. Following spec - Breaking:
web/BluetoothManufacturerDataFilternow requires a company identifier. Following spec - Breaking:
src/ServiceDataFilterBuildernow requires a service UUID. Following spec - Breaking:
src/ManufacturerDataFilterBuildernow requires a company identifier. Following spec
- Breaking:
web/js/AbortControllerhas been removed in favor of the implementation form thewebpackage - Breaking:
web/js/JSUtilshas been removed (this was an internal library so it shouldn't have any impact on most
projects) - Breaking:
web/NativeBluetoothnow returnsJSPromisesand other native objects instead ofobject - Breaking:
web/testingSetNavigator()now requires that you set awebnavigator object. - Breaking:
web/*alladdEventListenerandremoveEventListenerfunctions now extend fromweb/EventTarget - Breaking:
web/*all objects now implementJSObjectand have been marked with@JS. This also removes all
fromJSObjectconstructors. - Breaking: removed
web/WebBluetoothConverters web/WatchAdvertisementsOptionsthe signal property is now nullable. Following the spec.web/*created event streams usingBluetoothEventStreamProviders.- created
web/WebBluetoothValueEventfor theavailabilitychangedevent. - Changed example project to also use
dart:js_interopinstead ofdart:html. - Breaking: Removed all deprecated
BluetoothDefaultManufacturerIdentifierscases. That were deprecated pre this
release. - Breaking: Removed all deprecated
BluetoothDefaultServiceUUIDScases. That were deprecated pre this release.
Release notes
Open source →- Changed from
dart:htmltodart:js_interopto support wasm builds. - Dependencies:
- Bluetooth advertisements
- Breaking:
src/AdvertisementReceivedEventno longer extendsweb/AdvertisementReceivedEventInterface src/AdvertisementReceivedEventnow has awithMemoryconstructor- Breaking:
web/AdvertisementReceivedEventInterfaceno longer exists - Breaking:
web/WebAdvertisementReceivedEventhas been renamed toweb/BluetoothAdvertisementReceivedEvent - Breaking:
web/WebAdvertisementReceivedEvent.fromJSObjectconstructor no longer exists - Breaking:
web/WebAdvertisementReceivedEvent.withMemoryconstructor no longer exists
- Breaking:
- Bluetooth filters:
web/BluetoothScanFilterHelperis now deprecated. Useweb/BluetoothManufacturerDataFilter.create(),web/BluetoothServiceDataFilter.create(), andweb/BluetoothScanFilter.create()instead.- Breaking:
web/BluetoothServiceDataFilternow requires a service UUID. Following spec - Breaking:
web/BluetoothManufacturerDataFilternow requires a company identifier. Following spec - Breaking:
src/ServiceDataFilterBuildernow requires a service UUID. Following spec - Breaking:
src/ManufacturerDataFilterBuildernow requires a company identifier. Following spec
- Breaking:
web/js/AbortControllerhas been removed in favor of the implementation form thewebpackage - Breaking:
web/js/JSUtilshas been removed (this was an internal library so it shouldn't have any impact on most projects) - Breaking:
web/NativeBluetoothnow returnsJSPromisesand other native objects instead ofobject - Breaking:
web/testingSetNavigator()now requires that you set awebnavigator object. - Breaking:
web/*alladdEventListenerandremoveEventListenerfunctions now extend fromweb/EventTarget - Breaking:
web/*all objects now implementJSObjectand have been marked with@JS. This also removes allfromJSObjectconstructors. - Breaking: removed
web/WebBluetoothConverters web/WatchAdvertisementsOptionsthe signal property is now nullable. Following the spec.web/*created event streams usingBluetoothEventStreamProviders.- created
web/WebBluetoothValueEventfor theavailabilitychangedevent. - Changed example project to also use
dart:js_interopinstead ofdart:html. - Breaking: Removed all deprecated
BluetoothDefaultManufacturerIdentifierscases. That were deprecated pre this release. - Breaking: Removed all deprecated
BluetoothDefaultServiceUUIDScases. That were deprecated pre this release.
- Changed from
-
0.2.411 Oct 2024Release notes
Open source →- Updated
BluetoothDefaultManufacturerIdentifiers, some identifiers have been renamed, the old names have been marked
as deprecated.- Use
BluetoothDefaultManufacturerIdentifiers.manufacturerIdentifiersto get a list of all the non-deprecated
identifiers.
- Use
- Updated
BluetoothDefaultServiceUUIDSwith the latest service UUIDS. Some services now use the official name from the
Bluetooth SIG, the old names have been marked as deprecated.- Use
BluetoothDefaultServiceUUIDS.servicesto get a list of all the non-deprecated service UUIDS. - Added the
idfield to the enum, this contains the official Bluetooth SIG id of the UUID.
- Use
- Updated
BluetoothDefaultCharacteristicUUIDSwith the latest characteristic UUIDS. Some characteristic now use the
official name from the Bluetooth SIG, some characteristics no longer exist in the spec. The old names and values have
been marked as deprecated- Use
BluetoothDefaultCharacteristicUUIDS.characteristicsto get a list of all the non-deprecated characteristic
UUIDS. - Added the
idfield to the enum, this contains the official Bluetooth SIG id of the UUID.
- Use
- Updated docs to link to the current version of the
service,characteristic, andmanufacturer datablocklists
Release notes
Open source →- Updated
BluetoothDefaultManufacturerIdentifiers, some identifiers have been renamed, the old names have been marked as deprecated.- Use
BluetoothDefaultManufacturerIdentifiers.manufacturerIdentifiersto get a list of all the non-deprecated identifiers.
- Use
- Updated
BluetoothDefaultServiceUUIDSwith the latest service UUIDS. Some services now use the official name from the Bluetooth SIG, the old names have been marked as deprecated.- Use
BluetoothDefaultServiceUUIDS.servicesto get a list of all the non-deprecated service UUIDS. - Added the
idfield to the enum, this contains the official Bluetooth SIG id of the UUID.
- Use
- Updated
BluetoothDefaultCharacteristicUUIDSwith the latest characteristic UUIDS. Some characteristic now use the official name from the Bluetooth SIG, some characteristics no longer exist in the spec. The old names and values have been marked as deprecated- Use
BluetoothDefaultCharacteristicUUIDS.characteristicsto get a list of all the non-deprecated characteristic UUIDS. - Added the
idfield to the enum, this contains the official Bluetooth SIG id of the UUID.
- Use
- Updated docs to link to the current version of the
service,characteristic, andmanufacturer datablocklists- https://github.com/WebBluetoothCG/registries/blob/master/gatt_blocklist.txt
- https://github.com/WebBluetoothCG/registries/blob/master/manufacturer_data_blocklist.txt
- Updated
-
0.2.323 Feb 2024Release notes
Open source →- Added
optionalManufacturerDatatoRequestOptions. This is needed to get the manufacture data when watching
advertisements. - Added
BluetoothDefaultManufacturerIdentifiersenum with all the registered manufacturer identifiers - Fixed the conversion from a JS map to a dart map for manufacturer data and service data.
If you are listening to advertisements then these values will now be returned correctly. - Update dependencies.
Release notes
Open source →- Added
optionalManufacturerDatatoRequestOptions. This is needed to get the manufacture data when watching advertisements. - Added
BluetoothDefaultManufacturerIdentifiersenum with all the registered manufacturer identifiers - Fixed the conversion from a JS map to a dart map for manufacturer data and service data. If you are listening to advertisements then these values will now be returned correctly.
- Update dependencies.
- Added
-
0.2.229 Sep 2023Release notes
Open source →- Added
exclusionFilterstoRequestOptionsBuilder. - Added new MissingUserGestureError that you may need to handle.
- Updated dependencies to be more broad. (The minimum versions are still supported.)
Release notes
Open source →- Added
exclusionFilterstoRequestOptionsBuilder. - Added new MissingUserGestureError that you may need to handle.
- Updated dependencies to be more broad. (The minimum versions are still supported.)
- Added
-
0.2.102 Jun 2023 -
0.2.002 Apr 2023Release notes
Open source →- Breaking Removed SNAKE_CASE uuids.
- The default uuids are now an enum since dart supports enums with values.
- If you were using
defaultUuid.ordinalthen you should now usedefaultUuid.index. - Some names may slightly differ.
- Breaking Upgraded minimum dart sdk to
2.17 - Added
forgetto aBluetoothDevice, to forget a device.
Release notes
Open source →- Breaking Removed SNAKE_CASE uuids.
- The default uuids are now an enum since dart supports enums with values.
- If you were using
defaultUuid.ordinalthen you should now usedefaultUuid.index. - Some names may slightly differ.
- Breaking Upgraded minimum dart sdk to
2.17 - Added
forgetto aBluetoothDevice, to forget a device.
- Breaking Removed SNAKE_CASE uuids.
-
0.1.022 Dec 2022Release notes
Open source →Added
requestLEScantoBluetoothandFlutterWebBluetooth. You can now scan for devices advertisements without needing to pair with each device. However, a normal pair does need to happen before characteristics can be used.- Breaking in
Bluetooth.requestDevice()theRequestOptionsare no longer nullable. - Breaking
BluetoothDevice.gattis no longer marked as deprecated, it is still marked asvisibleForTesting. - Added bluetooth advertisements event to a bluetooth device. (Note this is still behind a flag in most browsers.)
- Support the newest version of logging.
- Continuing with the IOS Bluefy browser fix for characteristic properties.
- Added
hasmethods for all the fields in characteristic properties. - Return
falseas default value when a property doesn't exist. - Added
hasPropertiesmethod to check if there are any properties at all. Use this to test if the properties are
even reliable. - You can remove any try-catch logic around reading properties if you added those for the mitigation.
- Added
Note: The next version of the library will probably upgrade the minimum SDK from
2.12to2.17to keep up with other packages. If there are any good reasons to not do this then please create an issue on Github.Release notes
Open source →- Breaking in
Bluetooth.requestDevice()theRequestOptionsare no longer nullable. - Breaking
BluetoothDevice.gattis no longer marked as deprecated, it is still marked asvisibleForTesting. - Added bluetooth advertisements event to a bluetooth device. (Note this is still behind a flag in most browsers.)
- Support the newest version of logging.
- Added
requestLEScantoBluetoothandFlutterWebBluetooth. You can now scan for devices advertisements without needing to pair with each device. However, a normal pair does need to happen before characteristics can be used. - Continuing with the IOS Bluefy browser fix for characteristic properties.
- Added
hasmethods for all the fields in characteristic properties. - Return
falseas default value when a property doesn't exist. - Added
hasPropertiesmethod to check if there are any properties at all. Use this to test if the properties are even reliable. - You can remove any try-catch logic around reading properties if you added those for the mitigation.
- Added
- The next version of the library will probably upgrade the minimum SDK from
2.12to2.17to keep up with other packages. If there are any good reasons to not do this then please create an issue on Github.
- Breaking in
-
0.0.902 Sep 2022Release notes
Open source →Updated dependencies to work with Flutter 3.3.0
- Added a hotfix for the IOS Bluefy browser. As a side effect none of the characteristic properties are required anymore, but there are no methods yet to check if the properties exist. So add a try-catch around these methods for now! Thanks @rohitsangwan01 for the fix.
Release notes
Open source →- Added a hotfix for the IOS Bluefy browser. As a side effect none of the characteristic properties are required anymore, but there are no methods yet to check if the properties exist. So add a try-catch around these methods for now!
- Updated dependencies to work with Flutter 3.3.0
-
0.0.806 Jun 2022 -
0.0.727 Mar 2022Release notes
Open source →- Added
getCharacteristicsto the bluetooth service to get all the characteristics. - Set target platform to web for pub.dev target platform list (it will still compile when used in non-native programs.)
- Added documentation to the last few public interfaces
- Added
-
0.0.602 Jan 2022Release notes
Open source →- Removed RxDart as a dependency
- Added Dart Meta annotations to help with avoiding methods only meant for testing
- Added a lot of documentation
- Added more error handling and descriptions for when these errors may occur and how to avoid them
- Added characteristic descriptor
- Deprecated SNAKE_CASE for default uuids. Use the camelCase version instead
- Switched to using
loggerinstead ofprintstatements. This allows other developers to decide what to do with the log messages
-
0.0.6+102 Jan 2022Release notes
Open source →- Fixed the library trying to add the
availabilitychangedevent on unsupported platforms.
- Fixed the library trying to add the
-
0.0.6+202 Jan 2022Release notes
Open source →- Fixed the behavior subject stream not returning the stored value causing some implementations to wait forever.
-
0.0.517 Dec 2021Release notes
Open source →- Fixed typo in
characteristicvaluechangedfor theBluetoothCharacteristic.startNotifications(). ( Thanks AshTerry.) - Fixed crash when the device name of a bluetooth device is null. ( Thanks alextekartik.)
- A lot of small lint fixes, but that shouldn't impact a project based on this library. ( Thanks alextekartik.)
- Fixed typo in
-
0.0.430 May 2021Release notes
Open source →- Fixed call to
navigator.bluetooth.getDevicesin browsers that don't support it. - Added more documentation
- Fixed call to
-
0.0.323 May 2021 -
0.0.222 May 2021Release notes
Open source →- Removed Flutter as a dependency
- Added characteristic properties
- Added toLowerCase to every call that requires a UUID, because the web api expects only lower case UUIDS.
- Added Bluetooth descriptors.
-
0.0.120 May 2021