mirror of https://github.com/flutter/samples.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
268 B
13 lines
268 B
6 years ago
|
class User {
|
||
|
int id;
|
||
|
String username;
|
||
|
String avatarUrl;
|
||
|
|
||
|
User(this.id, this.username, this.avatarUrl);
|
||
|
|
||
|
static User fromJson(Map<String, dynamic> jsonMap) {
|
||
|
User user = User(jsonMap["id"], jsonMap["login"], jsonMap["avatar_url"]);
|
||
|
return user;
|
||
|
}
|
||
|
}
|