emit method
void
emit(
- String event, [
- dynamic arg0,
- dynamic arg1,
- dynamic arg2,
- dynamic arg3,
- dynamic arg4,
- dynamic arg5,
inherited
This function triggers all the handlers currently listening
to event
and passes them data
.
@param String event - The event to trigger
@param args
- The variable numbers of arguments to send to each handler
@return void
Implementation
void emit(String event, [arg0, arg1, arg2, arg3, arg4, arg5]) {
this._events[event]?.toList().forEach((Function func) {
callback(func, arg0, arg1, arg2, arg3, arg4, arg5);
});
this._eventsOnce.remove(event)?.forEach((Function func) {
callback(func, arg0, arg1, arg2, arg3, arg4, arg5);
});
}