Dheeraj Singh
Dheeraj Singh
import 'dart:convert'; class CountryList { final List photos; CountryList({ this.photos, }); factory CountryList.fromJson(List parsedJson) { List photos = new List(); photos = parsedJson.map((i)=>CountryResponse.fromJson(i)).toList(); return new CountryList( photos: photos ); }...
Hope this code snippet helped you.
json response > [ { "CountryId": 13, "CountryName": "Australia" }, { "CountryId": 230, "CountryName": "United Kingdom" } ] >