EventController class

Controller for managing calendar events (CRUD operations).

Stores events in memory and notifies listeners whenever the event list changes. Use getEventsForDate or getEventsForMonth to query events for display.

Inheritance

Constructors

EventController()

Properties

events List<CalendarEvent>
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addAll(List<CalendarEvent> events) → void
Adds multiple events at once.
addEvent(CalendarEvent event) → void
Adds a new event to the list.
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clear() → void
Removes all events.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
getEventsForDate(DateTime date) List<CalendarEvent>
Returns all events that occur on date, sorted by start time.
getEventsForMonth(int year, int month) List<CalendarEvent>
Returns all events that overlap with the given year and month.
getEventsGroupedByDate(DateTime start, DateTime end) Map<DateTime, List<CalendarEvent>>
Returns events grouped by date for the range from start to end.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeEvent(String id) → void
Removes the event with the given id.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
toString() String
A string representation of this object.
inherited
updateEvent(CalendarEvent event) → void
Updates an existing event, matched by its CalendarEvent.id.

Operators

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