toMap method
Converts the current ChatMessage
instance to a map.
This method uses the messageToMap
function to transform the
ChatMessage
object into a Map<String, String>
, which can be
useful for serialization or other operations that require a map
representation of the message.
Returns a Map<String, String>
representation of the ChatMessage
.
Implementation
Map<String, String> toMap() => messageToMap(this);