This commit is contained in:
hrxiang
2022-04-24 12:12:26 +08:00
parent fcc8373560
commit 6edf9b74fa
29 changed files with 545 additions and 27 deletions

View File

@@ -424,8 +424,16 @@ class AtElem {
String? text;
List<String>? atUserList;
bool? isAtSelf;
List<AtUserInfo>? atUsersInfo;
Message? quoteMessage;
AtElem({this.text, this.atUserList, this.isAtSelf});
AtElem({
this.text,
this.atUserList,
this.isAtSelf,
this.atUsersInfo,
this.quoteMessage,
});
AtElem.fromJson(Map<String, dynamic> json) {
text = json['text'];
@@ -433,6 +441,14 @@ class AtElem {
atUserList = (json['atUserList'] as List).map((e) => '$e').toList();
}
isAtSelf = json['isAtSelf'];
if (json['atUsersInfo'] is List) {
atUsersInfo = (json['atUsersInfo'] as List)
.map((e) => AtUserInfo.fromJson(e))
.toList();
}
quoteMessage = null != json['quoteMessage']
? Message.fromJson(json['quoteMessage'])
: null;
}
Map<String, dynamic> toJson() {
@@ -440,6 +456,8 @@ class AtElem {
data['text'] = this.text;
data['atUserList'] = this.atUserList;
data['isAtSelf'] = this.isAtSelf;
data['atUsersInfo'] = this.atUsersInfo?.map((e) => e.toJson()).toList();
data['quoteMessage'] = this.quoteMessage?.toJson();
return data;
}
}
@@ -705,3 +723,22 @@ class OfflinePushInfo {
return data;
}
}
class AtUserInfo {
String? atUserID;
String? groupNickname;
AtUserInfo({this.atUserID, this.groupNickname});
AtUserInfo.fromJson(Map<String, dynamic> json) {
atUserID = json['atUserID'];
groupNickname = json['groupNickname'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['atUserID'] = this.atUserID;
data['groupNickname'] = this.groupNickname;
return data;
}
}