RotatePageRoute constructor
RotatePageRoute({})
Implementation
RotatePageRoute({
required this.nextPage,
required this.currentPage,
this.numberOfRotations = 1,
this.clockwise = true,
animationDuration = const Duration(milliseconds: 500),
}) : super(
pageBuilder: (context, animation, secondaryAnimation) => nextPage,
transitionsBuilder: (context, animation, secondaryAnimation, child) {
final double rotationFactor = clockwise ? -1.0 : 1.0;
return RotationTransition(
turns: Tween<double>(
begin: numberOfRotations.toDouble() * rotationFactor,
end: 0.0,
).animate(animation),
child: animation.value.abs() > 0.5 ? child : currentPage,
);
},
transitionDuration: animationDuration,
);