add group fuc
This commit is contained in:
@@ -74,4 +74,8 @@ class ConversationInfo {
|
||||
data['isPinned'] = this.isPinned;
|
||||
return data;
|
||||
}
|
||||
|
||||
bool get isSingleChat => conversationType == ConversationType.single_chat;
|
||||
|
||||
bool get isGroupChat => conversationType == ConversationType.group_chat;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class GroupInfo {
|
||||
String? groupID;
|
||||
String groupID;
|
||||
String? groupName;
|
||||
String? notification;
|
||||
String? introduction;
|
||||
@@ -9,7 +9,7 @@ class GroupInfo {
|
||||
int? memberCount;
|
||||
|
||||
GroupInfo(
|
||||
{this.groupID,
|
||||
{required this.groupID,
|
||||
this.groupName,
|
||||
this.notification,
|
||||
this.introduction,
|
||||
@@ -18,8 +18,8 @@ class GroupInfo {
|
||||
this.createTime,
|
||||
this.memberCount});
|
||||
|
||||
GroupInfo.fromJson(Map<String, dynamic> json) {
|
||||
groupID = json['groupID'];
|
||||
GroupInfo.fromJson(Map<String, dynamic> json): groupID = json['groupID'] {
|
||||
/*groupID = json['groupID'];*/
|
||||
groupName = json['groupName'];
|
||||
notification = json['notification'];
|
||||
introduction = json['introduction'];
|
||||
@@ -126,7 +126,7 @@ class GroupInviteResult {
|
||||
|
||||
class GroupMemberRole {
|
||||
String? uid;
|
||||
int? setRole; //0普通成员,2管理员
|
||||
int? setRole;
|
||||
|
||||
GroupMemberRole({this.uid, this.setRole});
|
||||
|
||||
|
||||
@@ -2,16 +2,16 @@ class UserInfo {
|
||||
String uid;
|
||||
String? name;
|
||||
String? icon;
|
||||
int? gender; // 0 未知,1 男,2 女
|
||||
int? gender;
|
||||
String? mobile;
|
||||
String? birth;
|
||||
String? email;
|
||||
String? ex;
|
||||
String? comment;
|
||||
int? isInBlackList; // 0 不在黑名单,1 在黑名单
|
||||
int? isInBlackList;
|
||||
String? reqMessage;
|
||||
String? applyTime;
|
||||
int? flag; // //0请求添加好友,1同意添加好友,-1拒绝添加好友
|
||||
int? flag;
|
||||
|
||||
UserInfo(
|
||||
{required this.uid,
|
||||
@@ -61,5 +61,25 @@ class UserInfo {
|
||||
return data;
|
||||
}
|
||||
|
||||
String get nickname => comment ?? name ?? uid;
|
||||
String getShowName() {
|
||||
if (null != comment && comment!.trim().isNotEmpty) {
|
||||
return comment!;
|
||||
} else if (null != name && name!.trim().isNotEmpty) {
|
||||
return name!;
|
||||
}
|
||||
return uid;
|
||||
}
|
||||
|
||||
bool get isMan => gender == 1;
|
||||
|
||||
bool get isWoman => gender == 2;
|
||||
|
||||
/// blacklist
|
||||
bool get isBlocked => isInBlackList == 1;
|
||||
|
||||
/// friend application
|
||||
bool get isAgreed => flag == 1;
|
||||
|
||||
/// friend application
|
||||
bool get isRejected => flag == -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user