shake method

Widget shake({
  1. int delay = 0,
  2. double begin = 0,
  3. int duration = 500,
  4. bool repeat = false,
  5. bool reverse = false,
  6. bool autoPlay = true,
  7. Curve? curve,
  8. void onInit(
    1. AnimationController
    )?,
})

Shake Animation

Implementation

Widget shake(
        {int delay = 0,
        double begin = 0,
        int duration = 500,
        bool repeat = false,
        bool reverse = false,
        bool autoPlay = true,
        Curve? curve,
        void Function(AnimationController)? onInit}) =>
    animate(
        delay: delay.milliSeconds,
        autoPlay: autoPlay,
        onInit: onInit,
        onPlay: (controller) {
          if (repeat) {
            controller.repeat(reverse: reverse);
          }
        }).shake(duration: duration.milliSeconds, hz: 5);