rotateIn method

Widget rotateIn({
  1. Duration duration = const Duration(milliseconds: 300),
  2. double beginAngle = 0.0,
  3. double endAngle = 1.0,
})

Rotation animation

Implementation

Widget rotateIn({
  Duration duration = const Duration(milliseconds: 300),
  double beginAngle = 0.0,
  double endAngle = 1.0,
}) {
  return TweenAnimationBuilder<double>(
    tween: Tween(begin: beginAngle, end: endAngle),
    duration: duration,
    builder: (context, value, child) {
      return Transform.rotate(
        angle: value * 3.14159265359, // Convert to radians
        child: child,
      );
    },
    child: this,
  );
}