removeObserver method
Unregisters the given observer. This should be used sparingly as it is relatively expensive (O(N) in the number of registered observers).
See also:
- addObserver, for the method that adds observers in the first place.
Implementation
@override
void removeObserver(PowerSettingObserver observer) {
_observers.remove(observer);
if (_observers.isEmpty) {
_subscription?.cancel();
_subscription = null;
_unregister();
}
}