layoutItemHeight method

double layoutItemHeight(
  1. int sections,
  2. Size area
)

Implementation

double layoutItemHeight(int sections, Size area) {
  double sizingHeight = 0.0;

  if (sections == 1) {
    //item needs to be full height with w1 padding

    isDesktopDisplay(area) == false
        ? sizingHeight = area.height * 0.80
        : sizingHeight = area.height * 0.806;
  } else if (sections == 2) {
    //item needs to be 1/2 height for 2 sections

    isDesktopDisplay(area) == false
        ? sizingHeight = area.height * 0.43
        : sizingHeight = area.height * 0.397;
  } else if (sections == 3) {
    //item needs to be 1/3 height for 3 sections
    isDesktopDisplay(area) == false
        ? sizingHeight = area.height * 0.287
        : sizingHeight = area.height * 0.264;
  } else if (sections == 4) {
    //item needs to be 1/4 height for 4 sections
    isDesktopDisplay(area) == false
        ? sizingHeight = area.height * 0.216
        : sizingHeight = area.height * 0.195;
  } else if (sections == 5) {
    //item needs to be 1/5 height for 5 sections
    isDesktopDisplay(area) == false
        ? sizingHeight = area.height * 0.168
        : sizingHeight = area.height * 0.155;
  } else if (sections <= 6) {
    //item needs to be 1/5 height for 5 sections

    isDesktopDisplay(area) == false
        ? sizingHeight = area.height * 0.100
        : sizingHeight = area.height * 0.097;
  }

  return sizingHeight;
}