Event<T> class

Constructors

Event({required PlannerEntry<T> entry, required Manager<T> manager})

Properties

canvasRect Rect
The event's bounding rectangle in grid space — for a single-column event this is its drawn rect; for a spanning event it is the bounding box of all its segmentRects. Used for the accessibility node's rect and as the drag anchor (single-column events only).
getter/setter pair
columnCount int
getter/setter pair
columnIndex int
Which sub-column this event occupies within its day-column, and how many sub-columns the day-column is split into. They default to a single full-width column; Manager overwrites them with the day's overlap layout (#20) and then calls relayout.
getter/setter pair
dragType DragType
The drag/resize this event is currently undergoing, or DragType.none when idle. Exposed (#78) so the widget overlay can hand the live drag state to a custom PlannerEntryBuilder (via PlannerEntryLayout.dragType).
no setter
entry PlannerEntry<T>
The entry this event draws. Reassigned (never mutated) when a drag/resize or nudge commits, since PlannerEntry/PlannerTime are immutable (#27): the new instance is what flows on to PlannerConfig.onEntryMove.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
manager Manager<T>
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screenRect Rect
This event's current on-screen rectangle — its grid rect (including any live drag offset) mapped through the controller's scroll/zoom. Used by paint to draw it and by the accessibility layer to place the event's semantics node (#21).
no setter
segmentRects List<Rect>
The rectangles actually drawn and hit-tested, in grid space. A single-column event has exactly one (== canvasRect); a spanning event (#47) has one per covered column — a single continuous box in SpanOverlap.fullWidth, or one narrowed sub-column box per column in SpanOverlap.split.
getter/setter pair
semanticsLabel String
A screen-reader description of this event — its title, day-column label, time span and duration — so the otherwise-opaque CustomPaint canvas exposes each event to assistive technology (#21). English-only for now, matching the (also unlocalized) context-menu strings.
no setter

Methods

clearSpanColumns() → void
Clears any recorded span placement, so the next relayout draws the span at full column width (SpanOverlap.fullWidth). Manager calls this before re-laying out overlaps.
containsGridPoint(Offset point) bool
Whether point (grid space) falls inside any of this event's drawn rectangles — the hit-test primitive Manager.getEventAtPos uses. For a single-column event this is just canvasRect; for a spanning event it is any covered column's segment, so the event is reachable from any column it crosses.
dragTypeForGridPoint(Offset gridPos) DragType
The drag a press at gridPos (grid space) would begin: within 8px of the top edge resizes from the top, within 8px of the bottom resizes from the bottom, anywhere else moves the body. Shared by startDrag and the hover-cursor hit test (Manager.dragTypeAt) so the cursor shown over an event matches the drag a press there would actually start.
endDrag() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paint(Canvas canvas) → void
relayout() → void
Recomputes the geometry and text wrapping after columnIndex/columnCount (or, for a spanning event, its _spanColumns placement) change. Manager calls this once a day's overlap layout is known, so the event occupies its narrowed sub-column instead of the full day-column.
setSpanColumn(int column, int index, int count) → void
Records the sub-column (index of count) this spanning event was given in column's overlap cluster (SpanOverlap.split). Manager calls this per covered column while packing; relayout then rebuilds the geometry.
startDrag(Offset pos) → void
toString() String
A string representation of this object.
inherited
updateDrag(Offset pos) → void

Operators

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