emit method

void emit(
  1. String event, [
  2. dynamic arg0,
  3. dynamic arg1,
  4. dynamic arg2,
  5. dynamic arg3,
  6. dynamic arg4,
  7. 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);
  });
}