EventListener<CallbackDataT> constructor
EventListener<CallbackDataT> (
- String? type,
- EventCallback<
CallbackDataT> callback, { - bool once = false,
- bool protected = false,
- EventCallbackAdd<
CallbackDataT> ? onAdd, - EventCallbackRemove<
CallbackDataT> ? onRemove, - EventCallbackCall<
CallbackDataT> ? onCall, - EventCallbackCancel<
CallbackDataT> ? onCancel, - bool cancelAdded = true,
Event Listener
A listener is a subscription to a specific event type and data type.
This includes all the information needed for how to react with an event emitter.
Implementation
EventListener(
this.type,
this.callback, {
this.once = false,
this.protected = false,
this.onAdd,
this.onRemove,
this.onCall,
this.onCancel,
bool cancelAdded = true,
}) {
if (cancelAdded) {
appendCallback(
onAdd: (emitter) {
appendCallback(
onCancel: () => emitter.removeEventListener(this),
);
},
);
}
}