Skip to content

Commit 27abf14

Browse files
committed
update model file name
1 parent 3ea6f40 commit 27abf14

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

lib/model/search_user_ql.dart

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
}

0 commit comments

Comments
 (0)