EventListener class
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.
Constructors
- 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. ifcancel
callback is provided, then the listener can use that to cancel the subscription.
Properties
- callback → EventCallback
-
The event callback, which the subscriber uses when he register it for.
final
- cancel → CancelEvent
-
A mechanism to cancel the event.
final
- context → Object
-
The context from which subscriber is interested in.
final
- eventName → String
-
The event name, the subscriber subscribed to.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited