I try to make a GET http call from flutter to Nodejs. The data I get is in json form but when I try to manipulate it with flutter I can't because the response is of type RESPONSE
or I can change it to string
I don't know how to change the response
to type Map
to help me manipulate the data I get.
here the code :
Future getYear() async {
var url = "http://192.168.1.19:3000/getyear";
var response = await http.get(Uri.parse(url));
var jsonresponse = await json.decode(json.encode(response.body));
}
and here the data I get but I can't manipulate it [{"year":2019},{"year":2020}]
jsonDecode(response.body)
decodes the response to Map<String,dynamic>
.