TranslationAnimatedWidget.tween constructor
TranslationAnimatedWidget.tween({})
An translation animation using 2 values : enabled - disabled
duration : the duration of the animation, including intermediate values delay : the delay before the animation starts enabled : determine if the animation is stopped or fired curve : An easing curve, see Curve
translationDisabled : the default value of the widget translationEnabled : the animated value of the widget
animationFinished : a callback called when the animation is finished
Implementation
TranslationAnimatedWidget.tween({
Duration duration = const Duration(milliseconds: 500),
Duration delay = const Duration(),
Offset translationDisabled = const Offset(0, 200),
Offset translationEnabled = const Offset(0, 0),
bool enabled = true,
Function(bool)? animationFinished,
Curve curve = Curves.linear,
required Widget child,
}) : this(
duration: duration,
enabled: enabled,
curve: curve,
delay: delay,
child: child,
animationFinished: animationFinished,
values: [translationDisabled, translationEnabled],
);