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