messageToMap function
Implementation
Map<String, dynamic> messageToMap(InboxMessage inboxMessage) {
Map<String, dynamic> message = {
ID: inboxMessage.id,
CAMPAIGN_ID: inboxMessage.campaignId,
IS_CLICKED: inboxMessage.isClicked,
RECEIVED_TIME: inboxMessage.receivedTime,
EXPIRY_TIME: inboxMessage.expiry,
PAYLOAD: inboxMessage.payload,
TEXT_CONTENT: mapFromTextContent(inboxMessage.textContent),
ACTION: actionsListFromModel(inboxMessage.action)
};
Media? media = inboxMessage.media;
if (media != null) {
message[MEDIA_CONTENT] = mapFromMedia(media);
}
return message;
}