scrollUntilVisible static method

Future scrollUntilVisible(
  1. FinderBase<Element> finder,
  2. WidgetTester tester, {
  3. required Finder rootScrollView,
})

Implementation

static Future scrollUntilVisible(
    FinderBase<Element> finder, WidgetTester tester,
    {required Finder rootScrollView}) async {
  // Use this solution to ensure the scrollable finder is specific to the SingleChildScrollView
  final scrollableFinder = find.descendant(
    of: rootScrollView,
    matching: find.byType(Scrollable).at(0),
  );
  await tester.scrollUntilVisible(finder, 50, scrollable: scrollableFinder);
}