I'm getting the error messages:
Unhandled Exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'Future <dynamic>`
_LocationScreenState.build.<anonymous closure>
(package:clima/screens/location_screen.dart:71:32)
<asynchronous suspension>
The line being pinpointed is inside this:
FlatButton(
onPressed: () async {
var weatherData = await weather.getLocationWeather();
updateUI(weatherData); //<==it's this line
},
weather.getLocationWeather() returns a variable of type Future<dynamic>. It's JSON and, evaluating it in the debugger, it's the expected JSON. The upDateUI() method begins
void updateUI(Future<dynamic> weatherDataFuture) async {
final weatherData = await weatherDataFuture;
and then goes on to parse the resulting weatherData. It's called earlier in the program and works as expected. I'm sure the issue is connected to my never ending but still continuing battle to understand asynchronous programming :-)