EventListener constructor

EventListener(
  1. String eventName,
  2. Object context,
  3. EventCallback callback,
  4. CancelEvent cancel,
)

Constructor for Listener. This will take four arguments. eventName, callback are mandatory. context, cancel are optional. if cancel callback is provided, then the listener can use that to cancel the subscription.

Implementation

EventListener(this.eventName, this.context, this.callback, this.cancel);