addEventSubscription<V extends Event, W extends EventDetails<V>> method

void addEventSubscription<V extends Event, W extends EventDetails<V>>(
  1. {required String type,
  2. required EventCallback<W>? callback,
  3. required W eventTransformer(
    1. V event
    )}
)

Implementation

void addEventSubscription<V extends html.Event, W extends EventDetails<V>>({
  required final String type,
  required final EventCallback<W>? callback,
  required final W Function(V event) eventTransformer,
}) {
  if (callback != null) {
    _eventSubscriptions.add(
      element.on[type].listen(
        (final event) => callback(eventTransformer(event as V)),
      ),
    );
  }
}