Ive been trying to fetch json data from my flutter app. I managed to print the whole json on my console. I want to get only the "score" value from this json. How should I do it?
final String url = "http://www.mocky.io/v2/5aa3f9ee310000c21926e2f8";
Future<String> getJsonData() async{
http.Response response = await http.get(
Uri.encodeFull(url),
headers: {"Accept" : "application/json"}
);
print(response.body);
List data = json.decode(response.body);
print(data[0]["score"]);
}