simulateScroll method

void simulateScroll(
  1. Offset position, {
  2. double deltaX = 0,
  3. double deltaY = 0,
})

Simulates a scroll event at position with the given deltas.

PointerScrollEvent is the standard mechanism for mouse/trackpad scrolling. On touch devices, scrolling is better achieved with simulateSwipe.

Implementation

void simulateScroll(Offset position, {double deltaX = 0, double deltaY = 0}) {
  Log.i('[Gesture] 📜 SCROLL en $position (dx=$deltaX, dy=$deltaY)');
  GestureBinding.instance.handlePointerEvent(
    PointerScrollEvent(
      position: position,
      scrollDelta: Offset(deltaX, deltaY),
    ),
  );
}