添加 github Oauth ,个人中心

This commit is contained in:
yifeng.yl
2019-05-30 20:04:01 +08:00
parent dbcdbab7d2
commit 617e2953b3
13 changed files with 294 additions and 91 deletions

View File

@ -1,24 +1,25 @@
class UserInfo {
class UserInformation {
String username;
int id;
String avatarPic;
String themeColor;
String urlName;
UserInfo({
UserInformation({
this.avatarPic,
this.id,
this.themeColor,
this.urlName,
this.username,
});
factory UserInfo.fromJson(Map<String, dynamic> json) {
return UserInfo(
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: json['name'],
themeColor: json['theme_color'],
urlName: json['url_name']);
username: name,
themeColor: json['theme_color']);
}
}