scrollIntoView method

Future<void> scrollIntoView(
  1. SerializableFinder finder, {
  2. double alignment = 0.0,
  3. Duration? timeout,
})

Scrolls the Scrollable ancestor of the widget located by finder until the widget is completely visible.

If the widget located by finder is contained by a scrolling widget that lazily creates its children, like ListView or CustomScrollView, then this method may fail because finder doesn't actually exist. The scrollUntilVisible method can be used in this case.

Implementation

Future<void> scrollIntoView(SerializableFinder finder, { double alignment = 0.0, Duration? timeout }) async {
  await sendCommand(ScrollIntoView(finder, alignment: alignment, timeout: timeout));
}