-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathactivity_area.dart
53 lines (44 loc) · 1.35 KB
/
activity_area.dart
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
48
49
50
51
52
53
class ActivityArea {
final String id;
final String nameFr;
final String nameEn;
final DateTime createdAt;
final DateTime updatedAt;
ActivityArea(
{required this.id,
required this.nameFr,
required this.nameEn,
required this.createdAt,
required this.updatedAt});
/// Used to create [ActivityArea] instance from a JSON file
factory ActivityArea.fromJson(Map<String, dynamic> map) => ActivityArea(
id: map['id'] as String,
nameFr: map['nameFr'] as String,
nameEn: map['nameEn'] as String,
createdAt: DateTime.parse(map['createdAt'] as String),
updatedAt: DateTime.parse(map['updatedAt'] as String));
Map<String, dynamic> toJson() => {
'id': id,
'nameFr': nameFr,
'nameEn': nameEn,
'createdAt': createdAt.toString(),
'updatedAt': updatedAt.toString(),
};
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is ActivityArea &&
runtimeType == other.runtimeType &&
id == other.id &&
nameEn == other.nameEn &&
nameFr == other.nameFr &&
createdAt == other.createdAt &&
updatedAt == other.updatedAt;
@override
int get hashCode =>
id.hashCode ^
nameFr.hashCode ^
nameEn.hashCode ^
createdAt.hashCode ^
updatedAt.hashCode;
}