ensureVisible method Null safety

Future<void> ensureVisible(
  1. Finder finder
)

Given a widget W specified by finder and a Scrollable widget S in its ancestry tree, this scrolls S so as to make W visible.

Usually the finder for this method should be labeled skipOffstage: false, so that the Finder deals with widgets that are off the screen correctly.

This does not work when S is long enough, and W far away enough from the displayed part of S, that S has not yet cached W's element. Consider using scrollUntilVisible in such a situation.

See also:

Implementation

Future<void> ensureVisible(Finder finder) => Scrollable.ensureVisible(element(finder));