transform method
Implementation
@override
Widget transform(BuildContext context, Widget page, int index, int? currentPage, double pageDelta, int itemCount) {
if (index == currentPage) {
double width = MediaQuery.of(context).size.width;
return Transform(
transform: Matrix4.identity()..translate(width * pageDelta),
child: page,
);
} else {
return page;
}
}