courseCellHeight method

double courseCellHeight(
  1. int startIndex,
  2. CourseTableCellData cell
)

Height of a course cell, adding the noon row that a noon-crossing course covers without counting it in its span. That row is full height when another day has a noon course.

Implementation

double courseCellHeight(int startIndex, CourseTableCellData cell) {
  var remainingPeriods = cell.span;
  var includeSkippedNoon = cell.crossesNoon;
  var totalHeight = 0.0;

  for (final period in visiblePeriods.skip(startIndex)) {
    if (period == .nPeriod && includeSkippedNoon) {
      totalHeight += noonRowHeight;
      includeSkippedNoon = false;
      continue;
    }

    totalHeight += periodHeight(period);
    remainingPeriods--;
    if (remainingPeriods == 0) {
      break;
    }
  }

  return totalHeight;
}