File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ class SearchUserQL {
2+ final int ? followers;
3+ final String ? name;
4+ final String ? avatarUrl;
5+ final String ? bio;
6+ final String ? login;
7+ final String ? lang;
8+
9+ SearchUserQL ({
10+ this .followers,
11+ this .name,
12+ this .avatarUrl,
13+ this .bio,
14+ this .login,
15+ this .lang,
16+ });
17+
18+ static fromMap (Map map) {
19+ String ? lang;
20+ if (map["lang" ] != null &&
21+ map["lang" ]["nodes" ] != null &&
22+ map["lang" ]["nodes" ].length > 0 &&
23+ map["lang" ]["nodes" ][0 ]["languages" ] != null &&
24+ map["lang" ]["nodes" ][0 ]["languages" ]["nodes" ] != null &&
25+ map["lang" ]["nodes" ][0 ]["languages" ]["nodes" ].length > 0 ) {
26+ lang = map["lang" ]["nodes" ][0 ]["languages" ]["nodes" ][0 ]["name" ];
27+ }
28+ return SearchUserQL (
29+ followers: map["followers" ]? ["totalCount" ],
30+ name: map["name" ],
31+ avatarUrl: map["avatarUrl" ],
32+ bio: map["bio" ],
33+ login: map["login" ],
34+ lang: lang,
35+ );
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments