BallisticScrollActivity constructor Null safety
- ScrollActivityDelegate delegate,
- Simulation simulation,
- TickerProvider vsync
Creates an activity that animates a scroll view based on a simulation
.
The delegate, simulation
, and vsync
arguments must not be null.
Implementation
BallisticScrollActivity(
super.delegate,
Simulation simulation,
TickerProvider vsync,
) {
_controller = AnimationController.unbounded(
debugLabel: kDebugMode ? objectRuntimeType(this, 'BallisticScrollActivity') : null,
vsync: vsync,
)
..addListener(_tick)
..animateWith(simulation)
.whenComplete(_end); // won't trigger if we dispose _controller first
}