scroll method

  1. @override
Future<void> scroll(
  1. Finder finder, {
  2. double? dx,
  3. double? dy,
  4. Duration? duration = const Duration(milliseconds: 200),
  5. Duration? timeout = const Duration(seconds: 30),
})
override

Scrolls a descendant scrollable widget by the give parameters

Implementation

@override
Future<void> scroll(
  Finder finder, {
  double? dx,
  double? dy,
  Duration? duration = const Duration(milliseconds: 200),
  Duration? timeout = const Duration(seconds: 30),
}) async {
  final scrollableFinder = findByDescendant(
    finder,
    find.byType(Scrollable),
    matchRoot: true,
  );
  final state = nativeDriver.state(scrollableFinder) as ScrollableState;
  final position = state.position;
  position.jumpTo(dy ?? dx ?? 0);

  await nativeDriver.pump();
}