getToastColor static method

Color getToastColor(
  1. int index,
  2. int toastsCount
)

This method returns the toast color based on the index and the number of toasts

Implementation

static Color getToastColor(int index, int toastsCount) {
  if (toastsCount == 1) return _toastColors[0];
  if (toastsCount == 2) return _toastColors[1 - index];
  return _toastColors[2 - index];
}