toJson method
Implementation
Map<String, dynamic> toJson() {
return {
"senderId": senderId,
"message": message,
"time": DateTime.now().toUtc().toString(),
"read": read,
if (media != null) "media": media,
if (type != null) "type": type,
if (replyDocId != null) "replyDocId": replyDocId,
};
}