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