on<T extends EventType> method

void on<T extends EventType>(
  1. T eventType,
  2. void listener(
    1. T event
    )
)

call "on" to subscribe to events of a particular type

Subscribers will implement a callback function taking exactly one argument of the same type as the Event they wish to receive.

Thus:

on(EventCallState(),(EventCallState event){ -- do something here });

Implementation

void on<T extends EventType>(T eventType, void Function(T event) listener) {
  assert(listener != null, 'Null listener');
  assert(eventType != null, 'Null eventType');
  _addListener(eventType.runtimeType, listener);
}