removeListener method

void removeListener(
  1. ListenerCallback<S> listener, {
  2. bool ignoreAutoDispose = false,
})
inherited

remove a listener from the notifier

Implementation

void removeListener(
  ListenerCallback<T> listener, {
  bool ignoreAutoDispose = false,
}) {
  if (_listeners.isNotEmpty) {
    _listeners.remove(listener);

    if (!hasListeners && !ignoreAutoDispose) {
      _disposableCallback?.call();
    }
  }
}