════════ Исключение, обнаруженное библиотекой виджетов ═════════════════════════════════ ═════════════════════ следующий NoSuchMethodError был выброшен здание Builder: метод «[]» был вызван на нуль. Получатель: null Попытка вызова:
Соответствующий виджет, вызывающий ошибку, был: Файл MaterialApp: /// C: /Users/Ahmed/AndroidStudioProjects/weather_app/lib/main.dart: 9: 12 Когда возникло исключение, это был стек:
0 Object.noSuchMethod (dart: core-patch / object_patch.dart: 53: 5)
1 _LocationScreenState.UpdateUI. (пакет: weatherapp / screen / location_screen.dart: 27: 38)
2 State.setState (пакет: flutter / src / widgets / framework.dart: 1148: 30)
3 _LocationScreenState .UpdateUI (пакет: weatherapp / screen / location_screen.dart: 26: 5)
4 _LocationScreenState.initState (пакет: weatherapp / screen / location_screen.dart: 23: 1)
в # 1
`void UpdateUI(dynamic weatherdata){
setState(() {
double temp = weatherdata['main']['temp'];
temperature = temp.toInt();
var condition = weatherdata['weather'][0]['id'];
weatherIcon = weather.getWeatherIcon(condition);
weatherDescription = weather.getMessage(temperature);
cityname = weatherdata['name'];
});
}`
На # 4
```
void initState() {
super.initState();
UpdateUI(widget.locationWeather);
}
```
Я пытался получить данные из этой ссылки API ниже https://samples.openweathermap.org/data/2.5/weather?lat=35&lon=139&appid=50228b366a46bef0c96ee6e6cecd4b6a