-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathemployee.dart
More file actions
63 lines (59 loc) · 1.61 KB
/
employee.dart
File metadata and controls
63 lines (59 loc) · 1.61 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
class Employee {
final String imagePath;
final String name;
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.name,
required this.profession,
required this.country,
required this.email,
required this.phone,
required this.location,
required this.isDarkMode,
});
Employee copy({
String? imagePath,
String? name,
String? profession,
String? country,
String? email,
String? phone,
String? location,
bool? isDarkMode,
}) =>
Employee(
imagePath: imagePath ?? this.imagePath,
name: name ?? this.name,
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'],
name: json['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,
'name': name,
'profession': profession,
'country': country,
'email': email,
'phone': phone,
'location': location,
'isDarkMode': isDarkMode,
};
}