londonappbrewery / Clima-Flutter

Starter code for the Clima Project from the Complete Flutter Development Bootcamp
https://www.appbrewery.co
155 stars 740 forks source link

When I write the city name and pressing on "Get Weather" it throws me this error in the console #15

Open shaishalevss opened 4 years ago

shaishalevss commented 4 years ago

It also shows me the default location(of the android emulator), but I noticed in the console that I get this error: E/flutter (19578): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: NoSuchMethodError: Class 'Future' has no instance method '[]'. E/flutter (19578): Receiver: Instance of 'Future' E/flutter (19578): Tried calling:

this is my getCityWeather method: Future getCityWeather(String cityName) async { NetworkHelper networkHelper = NetworkHelper('$openWeatherMapURL?q=$cityName&appid=$apiKey&units=metric'); var weatherData = await networkHelper.getData(); return weatherData; }

please help me, I really want to finish this project already.

shaishalevss commented 4 years ago

I was able to fix that.

brobert04 commented 2 years ago

Can you tell me how did you fix it?

Saimonkabir commented 2 years ago

How did you fix the issue?

azinmapar commented 1 year ago

same problem

prashantsumfactor commented 1 year ago

@azinmapar , @shaishalevss , @brobert04 You should try this in your network helper class [ decode response body by json converter ]

Screenshot 2023-05-23 at 8 40 29 AM