handlePointerEventForSource method

void handlePointerEventForSource(
  1. PointerEvent event, {
  2. TestBindingEventSource source = TestBindingEventSource.device,
})

Dispatch an event to the targets found by a hit test on its position, and remember its source as pointerEventSource.

This method sets pointerEventSource to source, forwards the call to handlePointerEvent, then resets pointerEventSource to the previous value.

If source is TestBindingEventSource.device, then the event is based in the global coordinate space (for definitions for coordinate spaces, see TestWidgetsFlutterBinding) and the event is likely triggered by the user physically interacting with the screen during a live test on a real device (see LiveTestWidgetsFlutterBinding).

If source is TestBindingEventSource.test, then the event is based in the local coordinate space and the event is likely triggered by programmatically simulated pointer events, such as:

Implementation

void handlePointerEventForSource(
  PointerEvent event, {
  TestBindingEventSource source = TestBindingEventSource.device,
}) {
  withPointerEventSource(source, () => handlePointerEvent(event));
}