BallisticScrollActivity constructor Null safety

BallisticScrollActivity(
  1. ScrollActivityDelegate delegate,
  2. Simulation simulation,
  3. 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(
  ScrollActivityDelegate delegate,
  Simulation simulation,
  TickerProvider vsync,
) : super(delegate) {
  _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
}