once method
void
once(
- String event,
- EventListener listener, {
- EventPriority priority = EventPriority.normal,
- Object? subscriber,
override
Registers a one-time listener for event.
Creates a listener that will be automatically removed after its first execution.
This is a convenience method that calls on with once: true.
event - The name of the event to listen for
listener - The function to call once when the event is emitted
priority - Execution priority for the listener
subscriber - Optional object to associate with this listener
Implementation
@override
void once(
String event,
EventListener listener, {
EventPriority priority = EventPriority.normal,
Object? subscriber,
}) {
on(event, listener, priority: priority, once: true, subscriber: subscriber);
}