RotationAnimatedWidget.tween constructor

RotationAnimatedWidget.tween({
  1. Duration duration = const Duration(milliseconds: 500),
  2. Rotation rotationEnabled = const Rotation.radians(),
  3. Rotation rotationDisabled = const Rotation.radians(x: pi),
  4. bool enabled = true,
  5. Duration delay = const Duration(),
  6. dynamic animationFinished(
    1. bool
    )?,
  7. Curve curve = Curves.linear,
  8. 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

rotationDisabled : the default value of the widget (see Rotation) rotationEnabled : the animated value of the widget (see Rotation)

animationFinished : a callback called when the animation is finished

Implementation

RotationAnimatedWidget.tween({
  Duration duration = const Duration(milliseconds: 500),
  Rotation rotationEnabled = const Rotation.radians(),
  Rotation rotationDisabled = const Rotation.radians(x: pi),
  bool enabled = true,
  Duration delay = const Duration(),
  Function(bool)? animationFinished,
  Curve curve = Curves.linear,
  required Widget child,
}) : this(
          duration: duration,
          enabled: enabled,
          curve: curve,
          delay: delay,
          child: child,
          animationFinished: animationFinished,
          values: [rotationDisabled, rotationEnabled]);