removeListener method

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

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();
    }
  }
}