recentChatToJson function
Converts a RecentChat object into a JSON string.
This function takes a RecentChat object, converts it to a map using the toJson
method,
and then encodes the map as a JSON string.
Parameters:
data
- A RecentChat object.
Returns: A JSON string representing the recent chat.
Implementation
String recentChatToJson(RecentChat data) => json.encode(data.toJson());