RotationAnimatedWidget constructor

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

An rotation animation using 2-* values : enabled - disabled

Rotations can be

  • in in radians or degrees
  • in axis X, Y, Z

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 Rotation (degrees or rad) used for the animation,

  • the first : will be the rotationDisabled value
  • intermediate values : intermediate values between rotationDisabled & rotationEnabled
  • the last : will be the rotationEnabled value

animationFinished : a callback called when the animation is finished

Implementation

RotationAnimatedWidget({
  this.duration = const Duration(milliseconds: 500),
  List<Rotation> values = const [Rotation.radians(), Rotation.radians(x: pi)],
  this.enabled = true,
  this.delay = const Duration(),
  this.animationFinished,
  this.curve = Curves.linear,
  required this.child,
})   : this._values = values,
      assert(values.length > 1);