event_emitter/event_emitter library

Classes

Event
Event class. This is send back to the subscriber when an event is triggered, Subscriber can use the instance to retrieve the event data and other event related parameters. eventName is a mandatory parameter and will represent the current event.
EventEmitter
This class provides necessary implementations for subscribing and cancelling the event subscriptions and publishing events to the subcribers.
EventEmitterListener
EventEmitterListener is one who listen for specific event. EventEmitterListener register for notification with EventEmitter Once the listener is registered, a EventEmitterListener interface is returned back to the caller. Caller can use this EventEmitterListener interface to cancel the registration or check the state.

Typedefs

CancelEvent = void Function()
Handler for cancelling the event registration.
EventCallback = void Function(Event ev, Object? context)
The callback function to receive event notification. ev - Event event emitted by the publisher. context - Object passed while registering the subscription as context. This is useful especially when the listener want to receive context information for all future events emitted for the context.