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