on method

WidgetElement on(
  1. String eventName,
  2. dynamic fun(
    1. Element,
    2. Event
    )
)
inherited

Allows to create a custom HTML event, for example, if you can't find the desired one.

Implementation

WidgetElement on(String eventName, Function(Element, Event) fun) {
  // The element event can only be activated
  // after the element has been inserted.
  onMount((Element element) => element.on[eventName].listen((Event event) {
        fun.call(element, event);
      }));
  return this;
}