animateToPosition method
Scrolls the ScrollController to the given position with smooth animation.
offset is the target scroll position (in pixels).
duration specifies the duration of the scroll animation.
curve defines the curve for the animation (defaults to Curves.easeInOut).
Implementation
Future<void> animateToPosition(
double offset, {
Duration duration = const Duration(milliseconds: 300),
Curve curve = Curves.easeInOut,
}) {
return animateTo(offset, duration: duration, curve: curve);
}