Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

* fixed a bug where the stream of sensor values would not be properly closed when the device is disconnected, which could lead to memory leaks and other issues
* fixed a bug where ble subscriptions whould be cancelled for all devices when a single connection changes
* added methods to handle wearable factories
* remove wearable factory
* get all registered wearable factories
* clear all registered wearable factories

## 2.3.3

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ packages:
path: ".."
relative: true
source: path
version: "2.3.2"
version: "2.3.4"
path:
dependency: transitive
description:
Expand Down
19 changes: 19 additions & 0 deletions lib/open_earable_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,25 @@ class WearableManager {
_wearableFactories.add(factory);
}

/// Removes a wearable factory from the manager.
/// This can be used to stop supporting certain types of wearables.
/// Example usage:
/// ```dart
/// WearableManager().removeWearableFactory(MyCustomWearableFactory());
/// ```
void removeWearableFactory(WearableFactory factory) {
_wearableFactories.remove(factory);
}

/// Clears all registered wearable factories from the manager.
/// This will remove support for all wearables that rely on those factories.
void clearWearableFactories() {
_wearableFactories.clear();
}

/// Returns an unmodifiable list of the currently registered wearable factories.
List<WearableFactory> get wearableFactories => List.unmodifiable(_wearableFactories);

/// Starts scanning for BLE devices.
/// If `checkAndRequestPermissions` is true, it will check and request the necessary
/// permissions before starting the scan.
Expand Down