From f620eb2e53cbeac3145e757b016d03c84be0935c Mon Sep 17 00:00:00 2001 From: Dennis Moschina <45356478+DennisMoschina@users.noreply.github.com> Date: Mon, 23 Feb 2026 15:36:10 +0100 Subject: [PATCH 1/2] lib/open_earable_flutter.dart: Add methods to manage wearable factories in WearableManager --- lib/open_earable_flutter.dart | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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. From e1e7c141f29685ac0eddfb28fb288587f57a5851 Mon Sep 17 00:00:00 2001 From: Dennis Moschina <45356478+DennisMoschina@users.noreply.github.com> Date: Mon, 23 Feb 2026 15:39:05 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md for version 2.3.4: add methods to manage wearable factories, bumped version to 2.3.4 --- CHANGELOG.md | 4 ++++ example/pubspec.lock | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60f4459..5e2ab79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 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: