rotateDialog static method

Transform rotateDialog({
  1. required Widget child,
  2. required Animation<double> animation,
})

rotate dialog 360 degree animation

Implementation

static Transform rotateDialog({
  /// the child
  required Widget child,

  /// the animation as double
  required Animation<double> animation,
}) {
  // rotate the child
  return Transform.rotate(
    // using vector math library to get the angle as 360 degree and
    // convert it to radian
    angle: vectormath.radians(animation.value * 360),
    child: Opacity(
      opacity: animation.value,
      child: child,
    ),
  );
}