toJson method
Converts this message to a JSON representation.
Returns a Map containing all the message data in JSON format.
Implementation
Map<String, dynamic> toJson() => {
'id': id,
'content': content,
'isUser': isUser,
'timestamp': timestamp.toIso8601String(),
};