toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['msgID'] = msgID;
  data['timestamp'] = timestamp;
  data['progress'] = progress;
  data['sender'] = sender;
  data['nickName'] = nickName;
  data['friendRemark'] = friendRemark;
  data['faceUrl'] = faceUrl;
  data['nameCard'] = nameCard;
  data['groupID'] = groupID;
  data['userID'] = userID;
  data['status'] = status;
  data['elemType'] = elemType;
  data['id'] = id;
  data['needReadReceipt'] = needReadReceipt;
  if (textElem != null) {
    data['textElem'] = textElem!.toJson();
  }
  if (customElem != null) {
    data['customElem'] = customElem!.toJson();
  }
  if (imageElem != null) {
    data['imageElem'] = imageElem!.toJson();
  }
  if (soundElem != null) {
    data['soundElem'] = soundElem!.toJson();
  }
  if (videoElem != null) {
    data['videoElem'] = videoElem!.toJson();
  }
  if (fileElem != null) {
    data['fileElem'] = fileElem!.toJson();
  }
  if (locationElem != null) {
    data['locationElem'] = locationElem!.toJson();
  }
  if (faceElem != null) {
    data['faceElem'] = faceElem!.toJson();
  }
  if (groupTipsElem != null) {
    data['groupTipsElem'] = groupTipsElem!.toJson();
  }
  if (mergerElem != null) {
    data['mergerElem'] = mergerElem!.toJson();
  }
  data['localCustomData'] = localCustomData;
  data['localCustomInt'] = localCustomInt;
  data['cloudCustomData'] = cloudCustomData;

  data['isSelf'] = isSelf;
  data['isRead'] = isRead;
  data['isPeerRead'] = isPeerRead;
  data['priority'] = priority;
  if (offlinePushInfo != null) {
    data['offlinePushInfo'] = offlinePushInfo!.toJson();
  }
  if (groupAtUserList != null) {
    data['groupAtUserList'] = groupAtUserList;
  }
  data['seq'] = seq;
  data['random'] = random;
  data['isExcludedFromUnreadCount'] = isExcludedFromUnreadCount;
  data['isExcludedFromLastMessage'] = isExcludedFromLastMessage;
  data["isSupportMessageExtension"] = isSupportMessageExtension;
  data['messageFromWeb'] = messageFromWeb;
  data["hasRiskContent"] = hasRiskContent;
  data["revokeReason"] = revokeReason;
  data["isBroadcastMessage"] = isBroadcastMessage;
  data["isExcludedFromContentModeration"] = isExcludedFromContentModeration;
  if (revokerInfo != null) {
    data['revokerInfo'] = revokerInfo!.toJson();
  } else {
    data['revokerInfo'] = null;
  }
  return data;
}