transform method

  1. @override
Widget transform(
  1. BuildContext context,
  2. Widget page,
  3. int index,
  4. int? currentPage,
  5. double pageDelta,
  6. int itemCount,
)
override

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;
  }
}