on abstract method

StreamSubscription on(
  1. SCEvent event,
  2. Function callback
)

Registers callback as an event handler for event.

To cancel the callback, you can call .cancel on the returned StreamSubscription.

Implementation

StreamSubscription on(SCEvent event, Function callback);