remove<T extends EventType> method

void remove<T extends EventType>(
  1. T eventType,
  2. void listener(
    1. T event
    )?
)

Implementation

void remove<T extends EventType>(
    T eventType, void Function(T event)? listener) {
  List<dynamic>? targets = listeners[eventType.runtimeType];
  if (targets == null) {
    return;
  }
  //    logger.warn("removing $eventType on $listener");
  if (!targets.remove(listener)) {
    logger.warn('Failed to remove any listeners for EventType $eventType');
  }
}