removeObserver method
- WidgetsBindingObserver observer
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.
- WidgetsBindingObserver, which has an example of using this method.
Implementation
bool removeObserver(WidgetsBindingObserver observer) {
if (observer == _backGestureObserver) {
_backGestureObserver = null;
}
return _observers.remove(observer);
}