addEventListener static method

Function addEventListener(
  1. String eventName,
  2. Function callback
)

Add event listeners

Implementation

static Function addEventListener(String eventName, Function callback) {
  if (_listeners[eventName] == null) {
    _listeners[eventName] = [];
  }
  _listeners[eventName]?.add(callback);
  return callback;
}