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.
 
 
 
 
 
open-im-sdk-flutter-m/lib/models/user_info.dart

65 lines
1.7 KiB

class UserInfo {
String uid;
String? name;
String? icon;
int? gender; // 0 未知,1 男,2 女
String? mobile;
String? birth;
String? email;
String? ex;
String? comment;
int? isInBlackList; // 0 不在黑名单,1 在黑名单
String? reqMessage;
String? applyTime;
int? flag; // //0请求添加好友,1同意添加好友,-1拒绝添加好友
UserInfo(
{required this.uid,
this.name,
this.icon,
this.gender,
this.mobile,
this.birth,
this.email,
this.ex,
this.comment,
this.isInBlackList,
this.reqMessage,
this.applyTime,
this.flag});
UserInfo.fromJson(Map<String, dynamic> json) : uid = json['uid'] {
name = json['name'];
icon = json['icon'];
gender = json['gender'];
mobile = json['mobile'];
birth = json['birth'];
email = json['email'];
ex = json['ex'];
comment = json['comment'];
isInBlackList = json['isInBlackList'];
reqMessage = json['reqMessage'];
applyTime = json['applyTime'];
flag = json['flag'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['uid'] = this.uid;
data['name'] = this.name;
data['icon'] = this.icon;
data['gender'] = this.gender;
data['mobile'] = this.mobile;
data['birth'] = this.birth;
data['email'] = this.email;
data['ex'] = this.ex;
data['comment'] = this.comment;
data['isInBlackList'] = this.isInBlackList;
data['reqMessage'] = this.reqMessage;
data['applyTime'] = this.applyTime;
data['flag'] = this.flag;
return data;
}
String get nickname => comment ?? name ?? uid;
}