PlannerTime class

The position of an event on the planner grid: a day column index (into PlannerConfig.labels — there are no calendar dates here), a start hour and minutes, and a duration in minutes.

An event may also span columns (#47): when endDay is set to a column index after day, the event renders across the whole day..endDay range (a multi-day / multi-column event). This stays index-based — no DateTime enters the model (ADR 0001). endDay of null (or any value <= day) is a single-column event, the default.

An event may instead be all-day (#48): when allDay is true the event is not positioned by hour/minutes/duration at all — those are ignored — and instead renders as a chip in the all-day band above the time grid, under its column (day, or across day..endDay for a multi-day all-day event). Still index-based; no DateTime (ADR 0001).

Immutable (#27): every field is final, so a drag/resize or accessibility nudge produces a new instance via copyWith rather than mutating in place, which keeps diffing predictable and lets value == decide when anything actually changed.

Constructors

PlannerTime({int day = 0, int? endDay, int hour = 0, int minutes = 0, int duration = 60, bool allDay = false})

Properties

allDay bool
Whether this is an all-day event (#48). When true the event renders in the all-day band above the time grid rather than at an hour position, so hour/minutes/duration are ignored for layout; only day (and endDay for a multi-day all-day event) decide which column(s) it covers. Defaults to false — an ordinary hour-positioned event.
final
columnSpan int
How many columns the event covers (1 for a single-column event).
no setter
day int
final
duration int
final
endDay int?
Last column the event covers, inclusive. null (or <= day) means the event occupies the single column day. When greater than day the event spans the columns day..endDay — see lastDay / columnSpan for the normalized values the geometry uses.
final
hashCode int
The hash code for this object.
no setteroverride
hour int
final
lastDay int
The last column the event covers, inclusive and never before day: the raw endDay when it lies after day, otherwise day itself. Geometry and hit-testing iterate day..lastDay.
no setter
minutes int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
spansColumns bool
Whether the event covers more than one column (a spanning event).
no setter

Methods

copyWith({int? day, int? endDay, int? hour, int? minutes, int? duration, bool? allDay}) PlannerTime
Returns a copy with the given fields replaced; omitted fields are kept.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override