transform method
Implementation
@override
Widget transform(BuildContext context, Widget page, int index, int? currentPage, double pageDelta, int itemCount) {
if (index == currentPage) {
return Transform(
alignment: Alignment.center,
child: page,
transform: Matrix4.identity()
..setEntry(3, 2, 0.002)
..rotateY(-math.pi / 4 * pageDelta),
);
} else if (index == currentPage! + 1) {
return Transform(
alignment: Alignment.center,
child: page,
transform: Matrix4.identity()
..setEntry(3, 2, 0.002)
..rotateY(math.pi / 4 * (1 - pageDelta)),
);
} else {
return page;
}
}