country

Generated country class with country_generator using countries. This plugin is using countries to generate dart class.

Getting Started

Install

Add the following lines in your pubspec.yaml file

dependencies:
  country: ^latest_version

pub package

Class

Country

ParameterNullableDescription
alpha2two-letter country codes
alpha3three-letter country codes
continentcountry belongs
countryCodetelephone number prefixes
currencyCodealpha codes and numeric codes for the representation of currencies
gectwo-letter country codes that were used by the U.S. Government
geoGeoData. latitude, longitude and boundary information
internationalPrefixtrunk prefix used to select an international telephone circuit for placing an international call
iocthree-letter abbreviation country codes to refer to each group of athletes
isoLongNamefull name
isoShortNameshort name
languagesOfficialofficial languages
languagesSpokenspoken languages
nationalDestinationCodeLengthslengths of National Destination Code
nationalNumberLengthslengths of phone number
nationalPrefixphone prefix used in this country for dialing national numbers
nationalityidentification of a person in international law
numbernumeric code of country
postalCodeis this country uses postal codes in addresses
postalCodeFormatregex for valid postal codes
regionregion this country is in
startOfWeekstarting day of the week
subregionsubegion this country is in
unLocodeUN/LOCODE prefix for this country
unofficialNamesunofficial, slang names or aliases for this country
worldRegionThe World Region this country is in
addressFormattemplate for formatting addresses
vatRatesvalue-added tax rate
nanpPrefixNorth American Numbering Plan area codes
eeaMemberis a member of the European Economic Area
euMemberis a member of the European Union
esmMemberis a member of the European Single Market
altCurrencycomplementary currency
isoShortNameByLanguageMap for storing country short name by locale

GeoData

ParameterNullableDescription
coordinatecenter point of this country
maxCoordinatethe most northeast point of this country
minCoordinatethe most southwest point of this country
boundaryBoundingBox. bounding box of this country

BoundingBox

ParameterNullableDescription
northeastthe most northeast point of this country
southwestthe most southwest point of this country

Coordinate

ParameterNullableDescription
latitudelatitude is a geographic coordinate that specifies the north–south position of a point on the Earth's surface
longitudelongitude is a geographic coordinate that specifies the east–west position of a point on the Earth's surface

VatRates

ParameterNullableDescription
standardstandard rate
reducedreduced rates
superReducedsuper-reduced rate
parkingparking rate

Continent(enum class)

ParameterNullableDescription
wireNameActual value from json

Region(enum class)

ParameterNullableDescription
wireNameActual value from json

Week(enum class)

ParameterNullableDescription
wireNameActual value from json

WorldRegion(enum class)

ParameterNullableDescription
wireNameActual value from json

API

Flag emoji

e.g

String getCountryFlagEmoji(Country country) {
  return country.flagEmoji;
}

All country

e.g

void printAllCountry() {
  for (final country in Countries.values) {
    print(country);
  }
}
Short name by locale (flutter_country depend on Flutter)
Install

Add the following lines in your pubspec.yaml file

flutter_country:
  git:
    url: https://github.com/aaassseee/country.git
    path: flutter_country

e.g

String getShortNameByLocale(Country country) {
  return country.getIsoShortNameByLocale(const Locale('zh', 'HK'));
}

Maintainer

Jack Liu

Libraries

country