topicsFromJson function
Converts a JSON string into a list of Topics objects.
This function decodes the given JSON string and maps each JSON object to a Topics instance using the Topics.fromJson constructor.
Parameters:
str
- A JSON string representation of a list of Topics objects.
Returns: A list of Topics instances populated with data from the given JSON string.
Implementation
List<Topics> topicsFromJson(String str) =>
List<Topics>.from(json.decode(str).map((x) => Topics.fromJson(x)));