on method

void on(
  1. String event,
  2. EventHandler handler
)

Implementation

void on(String event, EventHandler handler) {
  _events.putIfAbsent(event, () => <EventHandler>[]);
  _events[event]!.add(handler);
}