simulateTap method

void simulateTap(
  1. Offset position
)

Simulates a tap (quick touch) at the position.

Generates a PointerDownEvent immediately followed by a PointerUpEvent. Flutter interprets this sequence as a complete tap and triggers the GestureDetectors with onTap / onPressed that contain that position.

Implementation

void simulateTap(Offset position) {
  final pointer = _nextPointer;
  Log.i(
    '[Gesture] 👆 TAP en (${position.dx.toStringAsFixed(1)}, ${position.dy.toStringAsFixed(1)})',
  );
  GestureBinding.instance.handlePointerEvent(
    PointerDownEvent(position: position, pointer: pointer),
  );
  GestureBinding.instance.handlePointerEvent(
    PointerUpEvent(position: position, pointer: pointer),
  );
}