I can't use ".body" , even if im trying to just "print(result.body);"
Im getting this error message:
String url = "https://jsonplaceholder.typicode.com/posts/1/comments";
var result = http.get(Uri.parse(url));
apiList = jsonDecode(result.body)
I have no idea how to fix, any help is welcomed. If you need aditional information, im ready to provide
CodePudding user response:
make your function async
, then
var result = await http.get(Uri.parse(url));