transform method
Implementation
@override
Widget transform(BuildContext context, Widget page, int index, int? currentPage, double pageDelta, int itemCount) {
if (index == currentPage) {
return Transform(
alignment: leftPageAlignment,
transform: Matrix4.identity()
..setEntry(3, 2, perspectiveScale)
..rotateY(rotationAngle * pageDelta),
child: page,
);
} else if (index == currentPage! + 1) {
return Transform(
alignment: rightPageAlignment,
transform: Matrix4.identity()
..setEntry(3, 2, perspectiveScale)
..rotateY(-rotationAngle * (1 - pageDelta)),
child: page,
);
} else {
return page;
}
}