sendMessageModelToJson function
Converts a ChatMessageModel object into a JSON string.
This function takes a ChatMessageModel object, converts it into a map
using the toJson
method, and then encodes this map as a JSON string.
Parameters:
data
- The ChatMessageModel object to be converted into a JSON string.
Returns: A JSON string representation of the ChatMessageModel object.
Implementation
String sendMessageModelToJson(ChatMessageModel data) =>
json.encode(data.toJson());