animateTo method

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

Animates the scroll position of all Sync 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));
  }
  await Future.wait(animations);
}