countries_list 0.1.6 copy "countries_list: ^0.1.6" to clipboard
countries_list: ^0.1.6 copied to clipboard

outdated

ISO-3166 Country and Dependent Territories Lists with UN Regional Codes. Country object contains phone code, flag emoji, alpha1, alpha2 etc. You can use it for creating your own country picker.

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
30
pub points
32%
popularity

Publisher

unverified uploader

ISO-3166 Country and Dependent Territories Lists with UN Regional Codes. Country object contains phone code, flag emoji, alpha1, alpha2 etc. You can use it for creating your own country picker.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on countries_list