getAllDayTimeAtPos method

PlannerTime getAllDayTimeAtPos(
  1. Offset bandLocalPos
)

The all-day PlannerTime a tap on empty band space at bandLocalPos (band-canvas coordinates) maps to — the band's counterpart to getTimeAtPos on the grid (#72). Undoes the horizontal scroll and the hour-gutter offset to find the column under the point, clamps it to a valid column, and flags it PlannerTime.allDay so create-on-empty-band yields an all-day entry. There is no hour/minute — an all-day time isn't positioned.

Implementation

PlannerTime getAllDayTimeAtPos(Offset bandLocalPos) {
  final localX =
      bandLocalPos.dx - controller.offset.dx - config.hourColumnWidth;
  final day =
      (localX / config.blockWidth).floor().clamp(0, config.labels.length - 1);
  return PlannerTime(day: day, allDay: true);
}