moveTo method

Future<void> moveTo(
  1. double to, {
  2. Duration? duration,
  3. Curve? curve,
  4. bool? clamp = true,
})

Calls ScrollPosition.jumpTo if duration is null or Duration.zero, otherwise ScrollPosition.animateTo is called.

If clamp is true (the default) then to is adjusted to prevent over or underscroll.

If ScrollPosition.animateTo is called then curve defaults to Curves.ease.

Implementation

Future<void> moveTo(
  double to, {
  Duration? duration,
  Curve? curve,
  bool? clamp = true,
}) {
  return _controller!.position.moveTo(
    to,
    duration: duration,
    curve: curve,
    clamp: clamp,
  );
}