toMap method
Implementation
@override
Map<String, dynamic> toMap() {
return {
"type": "chat",
"payload": {
"message": message,
"userId": userId,
"chatId": chatId,
"senderName": senderName,
"previousMessageUID": previousMessageUID,
"messageUID": messageUID,
"sender": sender,
"title": title,
"department": department?.toMap()
}
};
}