diff --git a/CHANGELOG.md b/CHANGELOG.md index 94da29d..1543327 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 2.3.4 + +* added methods to handle wearable factories + * remove wearable factory + * get all registered wearable factories + * clear all registered wearable factories + ## 2.3.3 * renamed TauRing to OpenRing diff --git a/example/pubspec.lock b/example/pubspec.lock index cb03378..2e0d5e6 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -350,7 +350,7 @@ packages: path: ".." relative: true source: path - version: "2.3.2" + version: "2.3.4" path: dependency: transitive description: diff --git a/lib/open_earable_flutter.dart b/lib/open_earable_flutter.dart index f0ca29f..77791f5 100644 --- a/lib/open_earable_flutter.dart +++ b/lib/open_earable_flutter.dart @@ -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 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. diff --git a/pubspec.yaml b/pubspec.yaml index 00f7d63..89caa60 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: open_earable_flutter description: This package provides functionality for interacting with OpenEarable devices. Control LED colors, control audio, and access raw sensor data. -version: 2.3.3 +version: 2.3.4 repository: https://github.com/OpenEarable/open_earable_flutter/tree/main platforms: