ensureVisible method
void
ensureVisible(
- GlobalKey<
State< key, {StatefulWidget> > - double alignment = 0.3,
- Duration? scrollDuration,
Brings view to the center of the screen
Implementation
// coverage:ignore-start
void ensureVisible(GlobalKey key,
{double alignment = 0.3, Duration? scrollDuration}) async {
try {
await Scrollable.ensureVisible(
key.currentContext!,
duration: scrollDuration ?? UINavigationSettings.transitionDuration,
alignment: alignment,
);
} catch (e) {
// ignore
}
}