on method
Add a listener
to be triggered for each event
.
Implementation
on(dynamic event, Function listener) {
assert(event is String || event is _EventFilterImpl,
'Event type must be valid.');
return callMethod(impl, 'on', [
event is EventFilter ? event.impl : event,
allowInterop(listener),
]);
}