eventify library Null safety

Eventify library. Eventify provides an effective interface for subscribing and emitting events. This framework also emits context based events. Subscriptions can be cancelled using the default cancellation logic available with subscriber itself.

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.
Listener
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.

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.