Hello I've an api that return a big list the min length of this list could be 100 or 120 element, and flutter decode only first 20 element is the list. Now that it seems to you that I load a very large json array elements and don't care about the api fast the req only takes 300 mille sec as possible The Api Is : https://newsapi.org/. I use http package for loading data and thats my code.
Future getEverythingFunc({@required String query}) async {
http.Response response = await http.get(Uri.parse(ApiReq.everyThingForSearchingUrl(query:query)));
if (response.statusCode >= 200 && response.statusCode <= 300) {
print(response.body);
return everythingModel = everythingModelFromJson(response.body);
} else if (response.statusCode >= 400 && response.statusCode <= 500) {
throw "Err while getting data ${response.statusCode}";
} else {
throw 'Unknown Err ${response.statusCode}';
}
}
Thanks for reading and hope you help me
response.body
and verified that the JSON are fully valid and does not contain any charset issues.