emitAsFuture method
Future
emitAsFuture(
- 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 Future
Implementation
Future<dynamic> emitAsFuture(String event,
[arg0, arg1, arg2, arg3, arg4, arg5]) async {
this._events[event]?.toList().forEach((Function func) async {
return await callbackAsFuture(func, arg0, arg1, arg2, arg3, arg4, arg5);
});
this._eventsOnce.remove(event)?.forEach((Function func) async {
return await callbackAsFuture(func, arg0, arg1, arg2, arg3, arg4, arg5);
});
}