getAspectRatio function

double getAspectRatio(
  1. int itemCount
)

Implementation

double getAspectRatio(int itemCount) {
  if (itemCount == 3) {
    return 2 / 1; // 2:1 aspect ratio for 3 items
  } else if (itemCount == 5) {
    return 2 / 1; // 2:1 aspect ratio for 5 items
  } else {
    return 1; // 1:1 aspect ratio for all other cases
  }
}