countries_list 0.1.7
countries_list: ^0.1.7

Flutter Android iOS web

ISO-3166 Country and Dependent Territories Lists with UN Regional Codes. Country object contains phone code, flag emoji, alpha1, alpha2 etc.

countries_list #

These lists are the result of parsing json data from this repo ISO-3166-Countries-with-Regional-Codes

Main methods: #

// return list of all countries
Future<List<Country>> getCountriesIso();
// return list of all countries which has phone codes
Future<List<Country>> getCountriesOnlyWithPhoneCode();

Country class: #

class Country {
  final String latinName;
  final CountryIso countryIso;
  final String phoneCode;
  final String flag;

  // for search
  bool contains(String t) {
    try {
      return latinName?.toLowerCase()?.contains(t.toLowerCase()) == true ||
          phoneCode?.toLowerCase()?.contains(t.toLowerCase()) == true ||
          countryIso?.alpha2?.toLowerCase()?.contains(t.toLowerCase()) ==
              true ||
          countryIso?.alpha3?.toLowerCase()?.contains(t.toLowerCase()) == true;
    } catch (error) {
      return false;
    }
  }
}

CountryIso class: #

class CountryIso {
  final String name;
  final String alpha2;
  final String alpha3;
  final String countryCode;
  final String iso31662;
  final Region region;
  final String subRegion;
  final IntermediateRegion intermediateRegion;
  final String regionCode;
  final String subRegionCode;
  final String intermediateRegionCode;
}
0
likes
110
pub points
46%
popularity

ISO-3166 Country and Dependent Territories Lists with UN Regional Codes. Country object contains phone code, flag emoji, alpha1, alpha2 etc.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

torin.dmitriy@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on countries_list