moveTo method

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

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

If animateTo is called then curve defaults to Curves.ease. The clamp parameter is ignored by this stub implementation but subclasses like ScrollPosition handle it by adjusting to to prevent over or underscroll.


Future<void> moveTo(
  double to, {
  Duration? duration,
  Curve? curve,
  bool? clamp,
}) {
  if (duration == null || duration == {
    return Future<void>.value();
  } else {
    return animateTo(to, duration: duration, curve: curve ?? Curves.ease);