removeEventListener<T> method

bool removeEventListener<T>(
  1. EventListener<T> listener
)

Removes a listener from the emitter.

This methods calls the onRemove method of the listener.

Implementation

bool removeEventListener<T>(EventListener<T> listener) {
  final removed = listeners.remove(listener);
  if (removed) listener.onRemove?.call(this);
  return removed;
}