mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-05-22 15:26:30 +08:00
26 lines
532 B
Dart
26 lines
532 B
Dart
class UserInformation {
|
|
String username;
|
|
int id;
|
|
String avatarPic;
|
|
String themeColor;
|
|
|
|
UserInformation({
|
|
this.avatarPic,
|
|
this.id,
|
|
this.themeColor,
|
|
this.username,
|
|
});
|
|
|
|
factory UserInformation.fromJson(Map<String, dynamic> json) {
|
|
String name = json['name'];
|
|
if(json['name'] == null){
|
|
name = json['url_name'];
|
|
}
|
|
return UserInformation(
|
|
avatarPic: json['avatar_pic'],
|
|
id: int.parse(json['id']),
|
|
username: name,
|
|
themeColor: json['theme_color']);
|
|
}
|
|
}
|