TranslationAnimatedWidget constructor

TranslationAnimatedWidget({
  1. Duration duration = const Duration(milliseconds: 500),
  2. Duration delay = const Duration(),
  3. List<Offset> values = const [Offset(0, 0), Offset(0, 200)],
  4. bool enabled = true,
  5. Curve curve = Curves.linear,
  6. dynamic animationFinished(
    1. bool
    )?,
  7. required Widget child,
})

An translation animation using 2-* values

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

values : list of Offset used for the animation,

  • the first : will be the translationDisabled value
  • intermediate values : intermediate values between translationDisabled & translationEnabled
  • the last : will be the translationEnabled value

animationFinished : a callback called when the animation is finished

Implementation

TranslationAnimatedWidget({
  this.duration = const Duration(milliseconds: 500),
  this.delay = const Duration(),
  List<Offset> values = const [Offset(0, 0), Offset(0, 200)],
  this.enabled = true,
  this.curve = Curves.linear,
  this.animationFinished,
  required this.child,
})   : this._values = values,
      assert(values.length > 1);