removeEventListener<T> method
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;
}