addEventListener method

void addEventListener(
  1. String type,
  2. EventListener? listener,
  3. [bool? useCapture]


void addEventListener(String type, EventListener? listener,
    [bool? useCapture]) {
  // TODO(leafp): This check is avoid a bug in our dispatch code when
  // listener is null.  The browser treats this call as a no-op in this
  // case, so it's fine to short-circuit it, but we should not have to.
  if (listener != null) {
    _addEventListener(type, listener, useCapture);