removeEventListener method

  1. @mustCallSuper
void removeEventListener(
  1. String eventType,
  2. EventHandler eventHandler
)

Implementation

@mustCallSuper
void removeEventListener(String eventType, EventHandler eventHandler) {
  if (_disposed) return;

  List<EventHandler>? currentHandlers = _eventHandlers[eventType];
  if (currentHandlers != null) {
    currentHandlers.remove(eventHandler);
    if (currentHandlers.isEmpty) {
      _eventHandlers.remove(eventType);
    }
  }
}