apiCallGet static method

Future apiCallGet(
  1. Uri url,
  2. BuildContext context
)

Implementation

static Future<dynamic> apiCallGet(Uri url, BuildContext context) async {
  return http.get(url).then((http.Response response) {
    List<dynamic> map = jsonDecode(response.body.toString());
    if (map.isNotEmpty) {
      ListUtil.countryList =
          List<CountryBean>.from(map.map((i) => CountryBean.fromJson(i)));
    }
    return map;
  });
}