SwiftTween<T> constructor
SwiftTween<T> (
- Tween<
T> _tween, { - double initialProgress = 0.0,
- TickerProvider? vsync,
Implementation
SwiftTween(
this._tween, {
double initialProgress = 0.0,
TickerProvider? vsync,
}) : _progress = Rx(initialProgress.clamp(0.0, 1.0)) {
_tickerProvider = vsync;
_progress.addListener(_updateValue);
_updateValue();
if (_tickerProvider != null) {
_controller = AnimationController(
vsync: _tickerProvider!,
duration: const Duration(milliseconds: 300),
);
_animation = CurvedAnimation(
parent: _controller!,
curve: Curves.easeInOut,
);
_animation!.addListener(_onAnimationUpdate);
}
}