animateTo method

Future<void> animateTo(
  1. double offset, {
  2. required Curve curve,
  3. required Duration duration,
})

Animates the scroll position of all linked controllers to offset.

Implementation

Future<void> animateTo(
  double offset, {
  required Curve curve,
  required Duration duration,
}) async {
  final animations = <Future<void>>[];
  for (final controller in _attachedControllers) {
    animations
        .add(controller.animateTo(offset, duration: duration, curve: curve));
  }
  return Future.wait<void>(animations).then<void>((List<void> _) => null);
}