scrollToTop method

Future<void>? scrollToTop(
  1. String key, {
  2. Duration duration = const Duration(milliseconds: 300),
  3. Curve curve = Curves.easeInOut,
})

Scrolls to the top of the scrollable for the controller with key.

Implementation

Future<void>? scrollToTop(
  String key, {
  Duration duration = const Duration(milliseconds: 300),
  Curve curve = Curves.easeInOut,
}) {
  return animateTo(key, 0, duration: duration, curve: curve);
}