DrivenScrollActivity.simulation constructor

DrivenScrollActivity.simulation(
  1. ScrollActivityDelegate delegate,
  2. Simulation simulation, {
  3. required TickerProvider vsync,
})

Creates an activity that drives a scroll view through an animation given by a Simulation.

Implementation

DrivenScrollActivity.simulation(
  super.delegate,
  Simulation simulation, {
  required TickerProvider vsync,
}) {
  _completer = Completer<void>();
  _controller =
      AnimationController.unbounded(
          debugLabel: objectRuntimeType(this, 'DrivenScrollActivity'),
          vsync: vsync,
        )
        ..addListener(_tick)
        ..animateWith(
          simulation,
        ).whenComplete(_end); // won't trigger if we dispose _controller before it completes.
}