DefaultEventStore class

The default class for storing CalendarEvents.

Inheritance

Constructors

DefaultEventStore({required List<Location> locations})
Create a DefaultEventStore with optional predefined locations.

Properties

dateIds Map<DateTime, Set<String>>
Map of the DateTime and event ids.
final
events Iterable<CalendarEvent>
A iterable of all CalendarEvents in the store.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
idEvent Map<String, CalendarEvent>
A Map containing all events.
final
locationDateIdMap Map<String, DateToEventIds>
Map of location strings to date maps.
final
locations List<Location>
Predefined locations for optimizations.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEvent(CalendarEvent event) → void
Add an event to the map.
addEventToLocation(Location? location, CalendarEvent event) → void
Add an event to the specified location in the locationDateIdMap.
addNewEvent(CalendarEvent event) String
Add a new event to the map.
override
byId(String id) CalendarEvent?
Retrieve a CalendarEvent by it's id if it exists.
override
clear() → void
Clear the locationDateIdMap and idEvent maps.
override
eventIdsFromDateTimeRange(InternalDateTimeRange dateTimeRange, Location? location) Set<String>
Retrieves the IDs of events that occur during the specified dateTimeRange.
override
hasDateToEventIds(String location) bool
Check if the locationDateIdMap contains the given location.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
populateAllLocations() → void
Populate all predefined locations in the locationDateIdMap.
populateLocation(Location? location) → void
Populate the locationDateIdMap with a new location if it does not exist.
removeById(String id) → void
Remove an event by its id.
override
removeEvent(CalendarEvent event) → void
Remove the event.
override
removeEvents(List<CalendarEvent> events) → void
Remove a list of CalendarEvents.
override
removeWhere(bool test(String key, CalendarEvent element)) → void
Remove events where where test returns true.
override
toKey(InternalDateTime date) String
Convert a InternalDateTime to a key string.
toString() String
A string representation of this object.
inherited
updateEvent(CalendarEvent event, CalendarEvent updatedEvent) → void
Update an event in the map with the updatedEvent.
override

Operators

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

Constants

defaultLocation → const String
The default location string.