EventDispatcher class
The Event Dispatcher.
Manages the registration and dispatching of events to listeners.
This is the engine behind the Event facade.
It supports mapping an Event Type to multiple Listener factories.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void - Clear all listeners, including wildcard ones.
-
dispatch(
MagicEvent event) → Future< void> - Dispatch an event to all registered listeners.
-
listenAny(
void callback(MagicEvent event)) → void Function() -
Register a wildcard listener, run after the typed listeners on every
dispatched event (Laravel's
Event::listen('*')). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
register(
Type eventType, List< MagicListener< listeners) → voidMagicEvent> Function()> - Register valid listeners for a specific event.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → EventDispatcher
-
no setter