I ran a flutter upgrade today...
I'm now on v0.2.11 and I'm getting a strange runtime error in this function:
Future apiCall([Map params = const {}]) async {
loading = true;
Map stringParams = {};
params.forEach((k,v)=>stringParams[k.toString()] = v.toString());
Uri url = new Uri.https(apiDomain, apiPath, stringParams);
print(url);
var result = await http.post(
url,
body: {'apikey': apiKey}
);
loading = false;
print(result.body);
return json.decode(result.body);
}
I'm calling the function without any params and I get the subtype error.
This code works in DartPad.
Does anyone have an idea what might be going on?