skip to Main Content

Unable to parse Json in Flutter

I used to parse JSON to list of objects by the following way: final response = await api(map); var raw = jsonDecode(response.body)[0]; dataList = parseJson(raw["datalist"]); List<dataRecord> parseJson(String responseBody) { final parsed = convert.jsonDecode(responseBody).cast<Map<String, dynamic>>(); return parsed.map<dataRecord>((json) => dataRecord.fromJson(json)).toList(); } and…

VIEW QUESTION
Back To Top
Search