dio
dio copied to clipboard
response.data is only working with some versions
I recently built my app for android from my office computer, though the code is synchronised through git. When I built the app, suddenly all the API calls are not working. When I looked into the issue, the response.data is no longer working.
` void getHttp() async { try { var response = await Dio().get('http://www.google.com'); print(response.data); ---> no longer can access .data } catch (e) { print(e); } }
`
for me it's returning no value when i try to print it with whencomplete
ok I installed the latest version of the package and it seems to be working fine now.
My project was using "dio: ^4.0.0"
I changed it to "dio: ^4.0.6"
so my theory is that, the project was probably installing a random version in between "4.0.0" - "4.0.6", which probably didn't have support for "response.data" or wasn't returning a Map.
@ldsouza93 try setting it to the latest version and re-build the application