toJson method

Map<String, dynamic> toJson()

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,
  };
}