transform method
Implementation
@override
Widget transform(BuildContext context, Widget page, int index, int? currentPage, double pageDelta, int itemCount) {
if (index == currentPage) {
double scale = 1 - pageDelta < zoomOutScale ? zoomOutScale : zoomOutScale + ((1 - pageDelta) - zoomOutScale);
return Transform(
alignment: Alignment.center,
child: enableOpacity ? Opacity(opacity: scale, child: page) : page,
transform: Matrix4.identity()..scale(scale, scale),
);
} else if (index == currentPage! + 1) {
double scale = pageDelta < zoomOutScale ? zoomOutScale : zoomOutScale + (pageDelta - zoomOutScale);
return Transform(
alignment: Alignment.center,
child: enableOpacity ? Opacity(opacity: scale, child: page) : page,
transform: Matrix4.identity()..scale(scale, scale),
);
} else {
return page;
}
}