addEventListener method

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

Implementation

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

  List<EventHandler>? existHandler = _eventHandlers[eventType];
  if (existHandler == null) {
    _eventHandlers[eventType] = existHandler = [];
  }

  existHandler.add(eventHandler);
}