DrivenScrollActivity constructor
- ScrollActivityDelegate delegate, {
- required double from,
- required double to,
- required Duration duration,
- required Curve curve,
- required TickerProvider vsync,
Creates an activity that animates a scroll view based on animation parameters.
Implementation
DrivenScrollActivity(
super.delegate, {
required double from,
required double to,
required Duration duration,
required Curve curve,
required TickerProvider vsync,
}) : assert(duration > Duration.zero) {
_completer = Completer<void>();
_controller = AnimationController.unbounded(
value: from,
debugLabel: objectRuntimeType(this, 'DrivenScrollActivity'),
vsync: vsync,
)
..addListener(_tick)
..animateTo(to, duration: duration, curve: curve)
.whenComplete(_end); // won't trigger if we dispose _controller before it completes.
}