vertical method

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

Implementation

Widget vertical(double aniValue, int index, double page, Widget child) {
  double indexAni = page - index;
  double gauss = math.exp(-(math.pow((indexAni.abs() - 0.5), 2) / 0.08)); //<--caluclate Gaussian function
  return Transform.translate(
    offset: Offset(0, -parallax * gauss * indexAni.sign),
    child: child,
  );
}