PlanCalendarController class

Owns selection + item state for a VooPlanCalendar. Works in day-relative space (Day 1..N). When startDate is set the controller can additionally compute the absolute date/weekday for any day in the plan.

Inheritance

Constructors

PlanCalendarController({required int totalDays, int initialDay = 1, DateTime? startDate, List<VooPlanItem> items = const []})

Properties

hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isActivated → bool
True once the user has activated the plan (i.e., we have a calendar anchor).
no setter
items → List<VooPlanItem>
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedDay → int
no setter
startDate → DateTime?
no setter
todayDayOffset → int?
The day offset that corresponds to DateTime.now(). Null if not activated or if today is outside the plan range.
no setter
totalDays → int
no setter

Methods

addItem(VooPlanItem item) → void
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dateForDay(int dayOffset) → DateTime?
Absolute date for dayOffset, or null if the plan is not activated.
dayTitleFor(int dayOffset) → String?
Returns the custom title for dayOffset, or null if none is set. The resolver is supplied by the host so plan-day data stays out of the controller — voo_calendar only needs read access.
dispose() → void
Discards any resources used by the object.
inherited
extendBy(int additionalDays) → void
Adds additionalDays to the visible plan length. Useful for "+ Add another week" affordances when the user wants to schedule items past the current max-day. The new length is persisted into the controller; callers usually also adjust their underlying total-days computation.
goToToday() → void
Jumps to the day the user is currently on, computed from startDate. No-op if the plan is not activated or now falls outside the plan.
itemCountForDay(int dayOffset) → int
itemsForDay(int dayOffset) → List<VooPlanItem>
nextDay() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
previousDay() → void
removeItem(String itemId) → void
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
selectDay(int dayOffset) → void
setDayTitleResolver(String? resolver(int dayOffset)?) → void
setItems(List<VooPlanItem> items) → void
setStartDate(DateTime? startDate) → void
setTotalDays(int totalDays) → void
toString() → String
A string representation of this object.
inherited
weekdayForDay(int dayOffset) → int?
Weekday index (1=Mon..7=Sun) for dayOffset, or null if not activated.

Operators

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