-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathdev.dart
More file actions
62 lines (55 loc) · 1.59 KB
/
dev.dart
File metadata and controls
62 lines (55 loc) · 1.59 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
class Dev {
String name;
List<String> roles;
List<String> skills;
String about;
String username;
Socials socials;
Dev({
this.name,
this.roles,
this.about,
this.username,
this.socials,
this.skills,
});
Dev.fromJson(Map<String, dynamic> json) {
name = json['name'];
roles = json['roles'].cast<String>();
skills = json['skills']?.cast<String>();
about = json['about'];
username = json['username'];
socials =
json['socials'] != null ? new Socials.fromJson(json['socials']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['name'] = this.name;
data['roles'] = this.roles;
data['skills'] = this.skills;
data['about'] = this.about;
data['username'] = this.username;
if (this.socials != null) {
data['socials'] = this.socials.toJson();
}
return data;
}
}
class Socials {
String twitter;
String facebook;
String linkedin;
Socials({this.twitter, this.facebook, this.linkedin});
Socials.fromJson(Map<String, dynamic> json) {
twitter = json['twitter'] != null ? json['twitter'] : '';
facebook = json['facebook'] != null ? json['facebook'] : '';
linkedin = json['linkedin'] != null ? json['linkedin'] : '';
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['twitter'] = this.twitter != null ? this.twitter : '';
data['facebook'] = this.facebook != null ? this.facebook : '';
data['linkedin'] = this.linkedin != null ? this.linkedin : '';
return data;
}
}