You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My code works perfectly with the sample link, but as soon as I try the API URL it crashes, I thought it was an error with the http package so I tried an alternative called Dio, but still crashes.
Oh wow, I'm an idiot.. I didn't put the getData() inside of getLocation() - i put it in initState() - so I was getting null values for my langitude and longitude.
My code works perfectly with the sample link, but as soon as I try the API URL it crashes, I thought it was an error with the http package so I tried an alternative called Dio, but still crashes.
The correct URL is https://api.openweathermap.org/data/2.5/weather?lat=-38.115958&lon=176.2232279&appid=ab049c97d78636ee1e507a36cc400930 which works perfectly.
Here's my code:
Here is the error:
The text was updated successfully, but these errors were encountered: