File tree Expand file tree Collapse file tree 9 files changed +46
-8
lines changed Expand file tree Collapse file tree 9 files changed +46
-8
lines changed Original file line number Diff line number Diff line change 1+ ## 0.0.7
2+
3+ * Added ` getCharacteristics ` to the bluetooth service to get all the characteristics.
4+ * Set target platform to web for [ pub.dev] ( https://pub.dev/packages/flutter_web_bluetooth/ ) target platform list (it will still compile when used in non-native programs.)
5+ * Added documentation to the last few public interfaces
6+
17## 0.0.6+2
28
39* Fixed the behavior subject stream not returning the stored value causing some implementations to wait forever.
Original file line number Diff line number Diff line change @@ -9,6 +9,13 @@ part of flutter_web_bluetooth;
99/// then it will throw a [NotSupportedError] .
1010///
1111class BluetoothCharacteristicProperties {
12+ ///
13+ /// A constructor for new characteristic properties.
14+ ///
15+ /// **This should only be done by the library or if you're testing.**
16+ ///
17+ /// To get an instance use [BluetoothCharacteristic.properties] .
18+ ///
1219 BluetoothCharacteristicProperties (this ._properties);
1320
1421 final WebBluetoothCharacteristicProperties _properties;
Original file line number Diff line number Diff line change @@ -7,6 +7,14 @@ part of flutter_web_bluetooth;
77/// See: [FlutterWebBluetooth] .
88///
99abstract class FlutterWebBluetoothInterface {
10+ ///
11+ /// An interface for [FlutterWebBluetooth] to make sure that both the
12+ /// unsupported and web version have the same api.
13+ ///
14+ /// See: [FlutterWebBluetooth] .
15+ ///
16+ FlutterWebBluetoothInterface ();
17+
1018 ///
1119 /// Get if the bluetooth api is available in this browser. This will only
1220 /// check if the api is in the `navigator` . Not if anything is available.
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ import 'dart:typed_data';
1414import 'package:flutter_web_bluetooth/js_web_bluetooth.dart' ;
1515import 'package:meta/meta.dart' ;
1616
17- import '../web_bluetooth_logger.dart' ;
1817import '../shared/web_behavior_subject.dart' ;
18+ import '../web_bluetooth_logger.dart' ;
1919
2020part 'bluetooth_characteristic.dart' ;
2121
@@ -61,6 +61,12 @@ class FlutterWebBluetooth extends FlutterWebBluetoothInterface {
6161
6262 static FlutterWebBluetooth ? _instance;
6363
64+ ///
65+ /// Get an instance of the library. There will always only be one instance.
66+ ///
67+ /// **Note:** this is the unsupported variant that is exposed in io builds,
68+ /// check the web version where the functions actually work!
69+ ///
6470 static FlutterWebBluetoothInterface get instance {
6571 return _instance ?? = FlutterWebBluetooth ._();
6672 }
Original file line number Diff line number Diff line change @@ -112,6 +112,19 @@ class _NativeBluetooth {
112112///
113113@visibleForTesting
114114class NativeBluetooth {
115+ ///
116+ /// Create a new instance of [NativeBluetooth] with the default
117+ /// implementations for the methods that will call the actual methods
118+ /// on the navigator in the background.
119+ ///
120+ /// Using the constructor can be used if you want to rest the native bluetooth
121+ /// implementation for testing using [setNativeBluetooth] .
122+ ///
123+ /// Otherwise the Fake library can be used to overwrite the methods for testing
124+ ///
125+ @visibleForTesting
126+ NativeBluetooth ();
127+
115128 ///
116129 /// Should return a promise (which will be converted to a future using
117130 /// [JSUtils.promiseToFuture] ) with a [bool] if bluetooth is available on
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ part of js_web_bluetooth;
66///
77/// You can get a [WebBluetoothRemoteGATTCharacteristic] from
88/// [WebBluetoothRemoteGATTService.getCharacteristic] , and
9- /// ignore: deprecated_member_use_from_same_package
109/// [WebBluetoothRemoteGATTService.getCharacteristics] .
1110///
1211/// See:
@@ -484,7 +483,6 @@ class WebBluetoothRemoteGATTCharacteristic {
484483 /// **This should only be done by the library or if you're testing.**
485484 ///
486485 /// To get an instance use [WebBluetoothRemoteGATTService.getCharacteristic] ,
487- /// ignore: deprecated_member_use_from_same_package
488486 /// and [WebBluetoothRemoteGATTService.getCharacteristics] .
489487 ///
490488 WebBluetoothRemoteGATTCharacteristic .fromJSObject (
Original file line number Diff line number Diff line change @@ -120,7 +120,6 @@ class WebBluetoothRemoteGATTService {
120120 ///
121121 /// See:
122122 ///
123- /// ignore: deprecated_member_use_from_same_package
124123 /// - [getCharacteristics]
125124 ///
126125 /// - https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/getCharacteristic
@@ -136,14 +135,12 @@ class WebBluetoothRemoteGATTService {
136135 }
137136
138137 ///
139- /// ignore: deprecated_member_use_from_same_package
140138 /// Check to see if the [getCharacteristics] function exists on the js object.
141139 ///
142140 /// It may not exist on some browsers.
143141 ///
144142 /// See:
145143 ///
146- /// ignore: deprecated_member_use_from_same_package
147144 /// - [getCharacteristics]
148145 ///
149146 bool hasGetCharacteristicsFunction () {
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ Logger get webBluetoothLogger {
2828}
2929
3030///
31- /// Overwrite the logger used so you can do decide where the log messages go.
31+ /// Overwrite the logger used so you can decide where the log messages go.
3232///
3333/// If you want to go back to the default logger at a later date then just call
3434/// [initWebBluetoothLogger] to overwrite the user set logger for the default one.
Original file line number Diff line number Diff line change 11name : flutter_web_bluetooth
22description : A library to use the web bluetooth api in your web project. Will play nice if used in IO projects.
3- version : 0.0.6+2
3+ version : 0.0.7
44homepage : https://github.com/jeroen1602/flutter_web_bluetooth/
55repository : https://github.com/jeroen1602/flutter_web_bluetooth/
66issue_tracker : https://github.com/jeroen1602/flutter_web_bluetooth/issues/
77
88environment :
99 sdk : " >=2.12.0 <3.0.0"
1010
11+ platforms :
12+ web :
13+
1114dependencies :
1215 js : ' >=0.6.3 <0.7.0'
1316 meta : ' >=1.3.0 <1.8.0'
You can’t perform that action at this time.
0 commit comments