calculateScaleFactor function

double calculateScaleFactor(
  1. List<MuqSnackbar> toastBars,
  2. MuqSnackbar current
)

rescale the old cards based on its position

Implementation

double calculateScaleFactor(
    List<MuqSnackbar> toastBars, MuqSnackbar current) {
  int index = toastBars.indexOf(current);
  int indexValFromLast = toastBars.length - 1 - index;
  double factor = indexValFromLast / 25;
  double res = 0.97 - factor;
  return res < 0 ? 0 : res;
}