Future<String> _loadCurrencies() async {
String uri = "http://api.exchangeratesapi.io/latest?access_key=apikey";
var response =
await http.get(Uri.parse(uri), headers: {"Accept": "application/json"});
var responseBody = json.decode(response.body);
Map curMap = responseBody['rates'];
currencies = curMap.keys.toList();
setState(() {});
print(currencies);
return "Success";
}
It shows the error A value of type 'List<dynamic>' can't be assigned to a variable of type 'List<String>'.
At first, I tried the as Map but I can't seem to solve this error.