dispatch method

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

Dispatches an event immediately and synchronously, bypassing the central event queue.

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

Implementation

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