1 year ago
#379560
ArQczeg14
How to get location from OpenWeatherMap API (Current Weather API), pass the data and compare to One Call API?
Now I'm working on Weather App (https://github.com/Arkadiusz4/Weather-App/tree/master/lib). For this project I use OpenWeatherMap API. I've already made a current weather using Current Weather API.
In Current Weather API there are information about city you search (you search cities in Search Bar) like name of city, latitude and longitude.
I want to expand app to have an hourly and weekly weather forecast. I want to use One Call API. There is a problem, that in this API are only information about latitude and longitude, but there's no name of city.
How I can get information from Current Weather API and write to some variables and then "rewrite" this variables to get data from One Call API for the same city?
I tried to equal some variables like this:
_responseCurrent?.coordinates.lat == _responseOnecall?.lat;
_responseCurrent?.coordinates.long == _responseOnecall?.long;
but there is error from One Call API (statusCode == 200) there's no city like this.
flutter
dart
weather
openweathermap
weather-api
0 Answers
Your Answer