RotateAnimation<T> constructor
Determines the direction of rotation. Constructor for the RotateAnimation class.
Implementation
/// Constructor for the RotateAnimation class.
RotateAnimation({required this.page, required this.isClockwise})
: super(
pageBuilder: (context, animation, secondaryAnimation) => page,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
final rotationValue = Tween<double>(
begin: 0.0,
end: isClockwise ? 2 * pi : -2 * pi,
).animate(animation);
return AnimatedBuilder(
animation: animation,
builder: (context, child) {
return Transform.rotate(
angle: rotationValue.value,
child: child,
);
},
child: child,
);
},
);