Listener is one who listen for specific event. Listener register for notification with EventEmitter Once the listener is registered, a Listener interface is returned back to the caller. Caller can use this Listener interface to cancel the registration or check the state.
- EventListener(String eventName, Object context, EventCallback callback, 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.
- callback → EventCallback
The event callback, which the subscriber uses when he register it for.
- cancel → CancelEvent
A mechanism to cancel the event.
- context → Object
The context from which subscriber is interested in.
- eventName → String
The event name, the subscriber subscribed to.
- hashCode → int
The hash code for this object.
- runtimeType → Type
A representation of the runtime type of the object.