calendar_event.dart
1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/// A calendar event extracted from a QRCode.
class CalendarEvent {
/// Create a new [CalendarEvent] instance.
const CalendarEvent({
this.description,
this.start,
this.end,
this.location,
this.organizer,
this.status,
this.summary,
});
/// Create a new [CalendarEvent] instance from a map.
factory CalendarEvent.fromNative(Map<Object?, Object?> data) {
return CalendarEvent(
description: data['description'] as String?,
start: DateTime.tryParse(data['start'] as String? ?? ''),
end: DateTime.tryParse(data['end'] as String? ?? ''),
location: data['location'] as String?,
organizer: data['organizer'] as String?,
status: data['status'] as String?,
summary: data['summary'] as String?,
);
}
/// The description of the calendar event.
final String? description;
/// The start time of the calendar event.
final DateTime? start;
/// The end time of the calendar event.
final DateTime? end;
/// The location of the calendar event.
final String? location;
/// The organizer of the calendar event.
final String? organizer;
/// The status of the calendar event.
final String? status;
/// The summary of the calendar event.
final String? summary;
}