toJson method
Implementation
Map<String, dynamic> toJson() => {
'senderId': senderId,
'roomId': roomId,
'_id': messageId,
'createdAt': time,
'text': text,
'file': file?.toJson(),
'time': fileTime,
'reacts': reacts,
};