recentChatListFromJson function
Converts a JSON string into a list of RecentChat objects.
This function decodes the provided JSON string into a list of maps, and then maps each one to a RecentChat object using the RecentChat.fromJson constructor.
Parameters:
str
- A JSON string representing a list of recent chats.
Returns: A list of RecentChat objects.
Implementation
List<RecentChat> recentChatListFromJson(String str) =>
List<RecentChat>.from(json.decode(str).map((x) => RecentChat.fromJson(x)));