transform method

  1. @override
Widget transform(
  1. int index,
  2. double page,
  3. double aniValue,
  4. Widget child,
)
override
 if (page == index) {
    /// 静止状态
  } else if (page > index) {
      <---- n+1页面出来 (index = n ; aniValue  1-0)
      -----> n-1页面出来 (index = n-1 ; aniValue  0-1)
  } else {
      <---- n+1页面出来 (index = n+1 ; aniValue  0-1)
      -----> n-1页面出来 (index = n ; aniValue  1-0)
  }

Implementation

@override
Widget transform(int index, double page, double aniValue, Widget child) {
  if (aniValue < 0) {
    return const SizedBox();
  }
  if (modifier?.scrollDirection == Axis.vertical) {
    return vertical(aniValue, index, page, child);
  } else {
    return horizontal(aniValue, index, page, child);
  }
}