scroll static method

Future scroll(
  1. Offset startOffset,
  2. Offset endOffset
)

Simulates a scroll gesture starting from the given start offset to the end offset.

Example:

await EaseSimulator.scroll(Offset(100, 200), Offset(100, 300));

Implementation

static Future scroll(Offset startOffset, Offset endOffset) async {
  GestureBinding.instance.handlePointerEvent(PointerDownEvent(
    position: startOffset,
    kind: PointerDeviceKind.touch,
  ));
  await Future.delayed(const Duration(milliseconds: 500));
  GestureBinding.instance.handlePointerEvent(PointerMoveEvent(
    position: endOffset,
    kind: PointerDeviceKind.touch,
  ));
  await Future.delayed(const Duration(milliseconds: 500));
  GestureBinding.instance.handlePointerEvent(PointerUpEvent(
    position: endOffset,
    kind: PointerDeviceKind.touch,
  ));
}