emit method
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);
}