transform method
Implementation
@override
Widget transform(BuildContext context, Widget page, int index, int? currentPage, double pageDelta, int itemCount) {
if (index == currentPage! + 1) {
return Transform.translate(
offset: Offset(-clipAmount * (1 - pageDelta), 0),
child: ClipRect(
child: page,
clipper: RectClipper(clipAmount * (1 - pageDelta)),
),
);
} else {
return page;
}
}