DrivenScrollActivity.simulation constructor
- ScrollActivityDelegate delegate,
- Simulation simulation, {
- 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.
}