getAllCountries method

Future<List<Country>> getAllCountries()

Implementation

Future<List<Country>> getAllCountries() async {
  Uri uri = _buildUri(
    "$_configPath/countries",
    {"api_key": _apiKey},
  );
  Response response = await getWithResilience(uri);

  if (response.statusCode != 200) {
    throw ClientException("request status not successful", uri);
  }
  List<dynamic> map = json.decode(response.body);

  return Country.listFromJson(map);
}