summaryrefslogtreecommitdiff
path: root/lib/models/event.dart
blob: 1c050ad4231f0f5a1609385a0fbfcaa5a73e3a5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
class Event {
  final int id;
  final String description;
  final DateTime date;
  final bool completed;

  const Event({
    required this.id,
    required this.description,
    required this.date,
    required this.completed,
  });

  factory Event.fromMap(Map<String, dynamic> map) {
    return Event(
      id: map["id"],
      description: map["description"],
      date: DateTime.parse(map["date"]),
      completed: map["completed"] == 1,
    );
  }
}