CalendarEvent<T> class

An event shown in calendar views. Pure Dart, so it works in models, repositories and server code without Flutter.

T is any payload you want to carry (your own model, an id, a map).

Constructors

CalendarEvent({required String id, required String title, required DateTime start, required DateTime end, bool isAllDay = false, String? description, String? location, int? color, RecurrenceRule? recurrence, List<DateTime> exceptionDates = const [], List<DateTime> additionalDates = const [], String? timeZone, String? calendarId, EventStatus status = EventStatus.confirmed, EventVisibility visibility = EventVisibility.normal, EventShowAs showAs = EventShowAs.busy, EventType type = EventType.normal, EventPerson? organizer, List<EventAttendee> attendees = const [], List<EventReminder> reminders = const [], String? url, String? meetingUrl, T? data})
Creates an event. end must not be before start.
CalendarEvent.allDay({required String id, required String title, required DateTime start, DateTime? end, String? description, String? location, int? color, RecurrenceRule? recurrence, T? data})
An all-day event covering start to end (inclusive days).
factory

Properties

additionalDates → List<DateTime>
Extra one-off dates added to the series (RDATE).
final
attendees → List<EventAttendee>
Invited people and their answers.
final
calendarId → String?
Which calendar (work, personal, holidays...) this event belongs to.
final
color → int?
ARGB colour such as 0xFF2196F3; null uses the theme's event colour.
final
data → T?
Your own payload.
final
description → String?
Optional notes.
final
duration → Duration
Length of each occurrence.
no setter
end → DateTime
End of the first occurrence.
final
exceptionDates → List<DateTime>
Dates removed from the series (EXDATE).
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
Unique id (also used as the iCalendar UID).
final
isAllDay → bool
Whether the event spans whole days.
final
isMultiDay → bool
Whether the first occurrence spans more than one calendar day.
no setter
isRecurring → bool
Whether this event repeats.
no setter
localEnd → DateTime
end converted to the device's local time (uses timeZone).
no setter
localStart → DateTime
start converted to the device's local time (uses timeZone).
no setter
location → String?
Optional location.
final
meetingUrl → String?
Video meeting link.
final
organizer → EventPerson?
Who owns the event.
final
recurrence → RecurrenceRule?
Repeat rule; null for one-off events.
final
reminders → List<EventReminder>
Notifications before the event.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showAs → EventShowAs
Whether the time counts as busy for free/busy lookups.
final
start → DateTime
Start of the first occurrence.
final
status → EventStatus
Confirmed, tentative or cancelled.
final
timeZone → String?
IANA id of the zone start/end are written in (e.g. Europe/Paris); null means device local time.
final
title → String
Title.
final
type → EventType
Normal event, out of office, focus time, working location, birthday, task or reminder.
final
url → String?
Related link.
final
visibility → EventVisibility
Who may see the details.
final

Methods

copyWith({String? id, String? title, DateTime? start, DateTime? end, bool? isAllDay, String? description, String? location, int? color, RecurrenceRule? recurrence, bool clearRecurrence = false, List<DateTime>? exceptionDates, List<DateTime>? additionalDates, String? timeZone, String? calendarId, EventStatus? status, EventVisibility? visibility, EventShowAs? showAs, EventType? type, EventPerson? organizer, List<EventAttendee>? attendees, List<EventReminder>? reminders, String? url, String? meetingUrl, T? data}) → CalendarEvent<T>
Copy with some fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
occurrencesIn(DateRange range) → Iterable<EventOccurrence<T>>
Every occurrence that touches range.
reminderTimes([DateTime? occurrenceStart]) → List<DateTime>
Every reminder's trigger time for the occurrence starting at occurrenceStart (the first one by default).
toString() → String
A string representation of this object.
override

Operators

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