vertical method

  1. @override
Widget vertical(
  1. double aniValue,
  2. int index,
  3. double page,
  4. Widget child,
)
override

Implementation

@override
Widget vertical(double aniValue, int index, double page, Widget child) {
  return Row(
    children: List.generate(shutterSize, (indexSub) {
      double intervalAni = 0;

      // if (page > index) {
      //   intervalAni = Interval(indexSub / shutterSize, (indexSub + 1) / shutterSize).transform(aniValue.abs());
      //   // return SizedBox.shrink();
      // } else {
      //   intervalAni = Interval((shutterSize - indexSub - 1) / shutterSize, (shutterSize - indexSub) / shutterSize)
      //       .transform(aniValue.abs());
      // }

      if (page > index) {
        intervalAni = Interval(indexSub * delay, 1 - (shutterSize - indexSub) * delay).transform(aniValue.abs());
        // return SizedBox.shrink();
      } else {
        int sub = shutterSize - indexSub;
        intervalAni = Interval(sub * delay, 1 - (shutterSize - sub) * delay).transform(aniValue.abs());
      }

      return ClipRect(
        child: Align(
          widthFactor: 1 / shutterSize,
          alignment: FractionalOffset(indexSub / (shutterSize - 1), 0),
          child: SizedBox(
            width: mediaQuery.size.width,
            child: super.vertical(intervalAni, index, page, child),
          ),
        ),
      );
    }),
  );
}