toJson method

Map<String, dynamic> toJson()

Converts a ChatMessageModel instance into a JSON object.

Implementation

Map<String, dynamic> toJson() => {
      "chatUserJid": chatUserJid,
      "contactType": contactType,
      "isItCarbonMessage": isItCarbonMessage,
      "isItSavedContact": isItSavedContact,
      "isMessageDeleted": isMessageDeleted,
      "isMessageRecalled": isMessageRecalled,
      "isMessageSentByMe": isMessageSentByMe,
      "isMessageStarred": isMessageStarred,
      "isSelected": isSelected,
      "isThisAReplyMessage": isThisAReplyMessage,
      "messageChatType": messageChatType,
      "messageCustomField": messageCustomField,
      "messageId": messageId,
      "messageSentTime": messageSentTime,
      "messageStatus": messageStatus,
      "isMessageEdited": isMessageEdited,
      "messageTextContent": messageTextContent,
      "messageType": messageType,
      "metaData": metaData == null
          ? null
          : List<dynamic>.from(metaData!.map((x) => x.toJson())),
      "replyParentChatMessage": replyParentChatMessage?.toJson(),
      "senderNickName": senderNickName,
      "senderUserJid": senderUserJid,
      "senderUserName": senderUserName,
      "contactChatMessage": contactChatMessage?.toJson(),
      "mediaChatMessage": mediaChatMessage?.toJson(),
      "locationChatMessage": locationChatMessage?.toJson(),
      "topicId": topicId
    };