emit method

void emit(
  1. Event<T> event, {
  2. EventScope scope = .local,
})
inherited

Queues an event into the central application event queue for asynchronous processing.

Stitches the Event.origin to this if it wasn't already set.

Implementation

void emit(Event<T> event, {EventScope scope = .local}) {
  event._reset();
  event.origin ??= self;
  event.scope ??= scope;
  event._wasEmitted = true;
  event._emitOrDispatchScope = event.scope!;
  _enqueueEvent(event);
}