transformRotate static method

VillainAnimation transformRotate({
  1. double toAngle = 0.0,
  2. required double fromAngle,
  3. Duration from = Duration.zero,
  4. required Duration to,
  5. Curve curve = Curves.linear,
})

Implementation

static VillainAnimation transformRotate({
  double toAngle = 0.0,
  required double fromAngle,
  Duration from = Duration.zero,
  required Duration to,
  Curve curve = Curves.linear,
}) =>
    VillainAnimation(
      curve: curve,
      from: from,
      to: to,
      animatable: Tween<double>(begin: fromAngle, end: toAngle),
      animatedWidgetBuilder: (animation, child) {
        return AnimatedBuilder(
          animation: animation,
          builder: (BuildContext a, Widget? b) {
            return Transform.rotate(
              angle: animation.value,
              child: child,
            );
          },
        );
      },
    );