DrivenScrollActivity constructor
Creates an activity that animates a scroll view based on animation parameters.
All of the parameters must be non-null.
Implementation
DrivenScrollActivity(
ScrollActivityDelegate delegate, {
@required double from,
@required double to,
@required Duration duration,
@required Curve curve,
@required TickerProvider vsync,
}) : assert(from != null),
assert(to != null),
assert(duration != null),
assert(duration > Duration.zero),
assert(curve != null),
super(delegate) {
_completer = Completer<void>();
_controller = AnimationController.unbounded(
value: from,
debugLabel: '$runtimeType',
vsync: vsync,
)
..addListener(_tick)
..animateTo(to, duration: duration, curve: curve)
.whenComplete(_end); // won't trigger if we dispose _controller first
}