ShakeAnimatedWidget constructor

ShakeAnimatedWidget({
  1. Duration duration = const Duration(milliseconds: 2000),
  2. Rotation shakeAngle = const Rotation.radians(z: 0.015),
  3. Curve curve = Curves.linear,
  4. bool enabled = true,
  5. Alignment alignment = Alignment.center,
  6. required Widget child,
})

A shake animation

duration : the duration of the animation, including intermediate values enabled : determine if the animation is stopped or fired curve : An easing curve, see Curve alignment : The center of the shake

shakeAngle : oscilate between 0, -shakeAngle, 0, shakeAngle, 0

  • can be in radians or degrees (see Rotation)

animationFinished : a callback called when the animation is finished

Implementation

ShakeAnimatedWidget({
  this.duration = const Duration(milliseconds: 2000),
  this.shakeAngle = const Rotation.radians(z: 0.015),
  this.curve = Curves.linear,
  this.enabled = true,
  this.alignment = Alignment.center,
  required this.child,
});