You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
print('Location: ${event.location ?? "No location"}');
88
89
print('Description: ${event.description ?? ""}');
89
90
91
+
// Extension properties
92
+
print('Is recurring: ${event.isRecurring}');
93
+
print('Is all-day: ${event.isAllDay}');
94
+
print('Is multi-day: ${event.isMultiDay}');
95
+
print('Duration: ${event.effectiveDuration}');
96
+
90
97
// Attendees
91
98
for (final attendee in event.attendees) {
92
99
print('Attendee: ${attendee.address}');
@@ -144,26 +151,45 @@ for (final occurrence in event.occurrences().take(10)) {
144
151
145
152
### Filtering Events by Date Range
146
153
147
-
Use the `inRange` extension to filter events that occur within a specific date range. This works correctly with multi-day events, all-day events, and recurring events. Results are always returned in chronological order, regardless of the order in the source file.
154
+
Use the `occurrences` extension to filter events that occur within a specific date range. This works correctly with multi-day events, all-day events, and recurring events. Results are always returned in chronological order, regardless of the order in the source file.
148
155
149
156
```dart
150
157
final start = CalDateTime.date(2024, 3, 1);
151
158
final end = CalDateTime.date(2024, 3, 31);
152
159
153
160
// Get all event occurrences in March 2024
154
-
final occurrencesInMarch = calendar.events.inRange(start, end);
161
+
final occurrencesInMarch = calendar.events.occurrences(
final todoOccurrences = calendar.todos.inRange(start, end);
171
+
final todoOccurrences = calendar.todos.occurrences(
172
+
start: start,
173
+
end: end,
174
+
);
175
+
```
176
+
177
+
### Getting All Occurrences
178
+
179
+
When you need all occurrences across multiple components without filtering by date range, simply call `occurrences()` without parameters. Use `.take()` to limit results when working with recurring events that could generate infinite occurrences.
180
+
181
+
```dart
182
+
// Get all occurrences without date filtering
183
+
final allOccurrences = calendar.events.occurrences();
0 commit comments