horizontal method

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

Implementation

Widget horizontal(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(-parallax * gauss * indexAni.sign, 0),
    child: child,
  );
}