-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathemployee.dart
More file actions
75 lines (71 loc) · 1.98 KB
/
employee.dart
File metadata and controls
75 lines (71 loc) · 1.98 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
class Employee {
final String imagePath;
final String id;
final String firstName;
final String lastName;
final String profession;
final String country;
final String email;
final String phone;
final String location;
final bool isDarkMode;
const Employee({
required this.imagePath,
required this.id,
required this.firstName,
required this.lastName,
required this.profession,
required this.country,
required this.email,
required this.phone,
required this.location,
required this.isDarkMode,
});
Employee copy({
String? imagePath,
String? id,
String? firstName,
String? lastName,
String? profession,
String? country,
String? email,
String? phone,
String? location,
bool? isDarkMode,
}) =>
Employee(
imagePath: imagePath ?? this.imagePath,
id: id ?? this.id,
firstName: firstName ?? this.firstName,
lastName: lastName ?? this.lastName,
profession: profession ?? this.profession,
country: country ?? this.country,
email: email ?? this.email,
phone: phone ?? this.phone,
location: location ?? this.location,
isDarkMode: isDarkMode ?? this.isDarkMode);
static Employee fromJson(Map<String, dynamic> json) => Employee(
imagePath: json['imagePath'],
id: json['ID'],
firstName: json['First Name'],
lastName: json['last Name'],
profession: json['profession'],
country: json['country'],
email: json['email'],
phone: json['phone'],
location: json['location'],
isDarkMode: json['isDarkMode'],
);
Map<String, dynamic> toJson() => {
'imagePath': imagePath,
'ID': id,
'First Name': firstName,
'Last Name': lastName,
'profession': profession,
'country': country,
'email': email,
'phone': phone,
'location': location,
'isDarkMode': isDarkMode,
};
}