crossAxisCellCount method

int crossAxisCellCount(
  1. int length,
  2. int index
)

Implementation

int crossAxisCellCount(int length, int index) {
  if (length == 1) {
    return 6;
  } else if (length == 2) {
    return 3;
  } else if (length == 3) {
    if (index < 1) return 6;
    return 3;
  } else {
    if (index < 1) return 6;
    return 2;
  }
}