calculatePosition function

double calculatePosition(
  1. List<MuqSnackbar> toastBars,
  2. MuqSnackbar self
)

calculate position of old cards based on current position

Implementation

double calculatePosition(
    List<MuqSnackbar> toastBars, MuqSnackbar self) {
  if (toastBars.isNotEmpty && self != toastBars.last) {
    final box = self.info.key.currentContext?.findRenderObject() as RenderBox?;
    if (box != null) {
      return gapBetweenCard * (toastBars.length - toastBars.indexOf(self) - 1);
    }
  }
  return 0;
}