emit method

void emit(
  1. String event, [
  2. dynamic data
])

Implementation

void emit(String event, [dynamic data]) {
  final list0 = _events[event];

  final list = list0 != null ? List.from(list0) : null;
  list?.forEach((handler) {
    handler(data);
  });

  _eventsOnce.remove(event)?.forEach((EventHandler handler) {
    handler(data);
  });
}