TranslationAnimatedWidget.tween constructor

TranslationAnimatedWidget.tween({
  1. Duration duration = const Duration(milliseconds: 500),
  2. Duration delay = const Duration(),
  3. Offset translationDisabled = const Offset(0, 200),
  4. Offset translationEnabled = const Offset(0, 0),
  5. bool enabled = true,
  6. dynamic animationFinished(
    1. bool
    )?,
  7. Curve curve = Curves.linear,
  8. required Widget child,
})

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],
      );