dispatchEvent method

  1. @override
void dispatchEvent(
  1. PointerEvent event,
  2. HitTestResult? hitTestResult

Dispatch an event to pointerRouter and the path of a hit test result.

The event is routed to pointerRouter. If the hitTestResult is not null, the event is also sent to every HitTestTarget in the entries of the given HitTestResult. Any exceptions from the handlers are caught.

The hitTestResult argument may only be null for PointerAddedEvents or PointerRemovedEvents.


void dispatchEvent(PointerEvent event, HitTestResult? hitTestResult) {
  switch (pointerEventSource) {
    case TestBindingEventSource.test:
      super.dispatchEvent(event, hitTestResult);
    case TestBindingEventSource.device:
      assert(hitTestResult != null || event is PointerAddedEvent || event is PointerRemovedEvent);
      if (shouldPropagateDevicePointerEvents) {
        super.dispatchEvent(event, hitTestResult);
      assert(deviceEventDispatcher != null);
      if (hitTestResult != null) {
        deviceEventDispatcher!.dispatchEvent(event, hitTestResult);