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
latest version

API
Short name by locale (flutter_country_utility depend on Flutter)
Install
Replace country by installing the following lines in your pubspec.yaml file
flutter_country_utility: ^latest_version
latest version

e.g
String getShortNameByLocale(Country country) {
return country.getIsoShortNameByLocale(const Locale('zh', 'HK'));
}
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);
}
}
Class
Country
| Parameter |
Nullable |
Description |
| alpha2 |
✗ |
two-letter country codes |
| alpha3 |
✗ |
three-letter country codes |
| continent |
✗ |
country belongs |
| countryCode |
✗ |
telephone number prefixes |
| currencyCode |
✗ |
alpha codes and numeric codes for the representation of currencies |
| distanceUnit |
✗ |
distance unit |
| gec |
✓ |
two-letter country codes that were used by the U.S. Government |
| geo |
✗ |
GeoData. latitude, longitude and boundary information |
| internationalPrefix |
✓ |
trunk prefix used to select an international telephone circuit for placing an international call |
| ioc |
✓ |
three-letter abbreviation country codes to refer to each group of athletes |
| isoLongName |
✗ |
full name |
| isoShortName |
✗ |
short name |
| languagesOfficial |
✗ |
official languages |
| languagesSpoken |
✗ |
spoken languages |
| nationalDestinationCodeLengths |
✗ |
lengths of National Destination Code |
| nationalNumberLengths |
✗ |
lengths of phone number |
| nationalPrefix |
✓ |
phone prefix used in this country for dialing national numbers |
| nationality |
✓ |
identification of a person in international law |
| number |
✗ |
numeric code of country |
| postalCode |
✗ |
is this country uses postal codes in addresses |
| postalCodeFormat |
✓ |
regex for valid postal codes |
| region |
✓ |
region this country is in |
| startOfWeek |
✗ |
starting day of the week |
| subregion |
✓ |
subregion this country is in |
| unLocode |
✗ |
UN/LOCODE prefix for this country |
| unMember |
✗ |
is a member of the United Nations |
| unofficialNames |
✗ |
unofficial, slang names or aliases for this country |
| vehicleRegistrationCode |
✓ |
The vehicle registration code for this Country |
| worldRegion |
✗ |
The World Region this country is in |
| addressFormat |
✓ |
template for formatting addresses |
| vatRates |
✓ |
value-added tax rate |
| nanpPrefix |
✓ |
North American Numbering Plan area codes |
| eeaMember |
✓ |
is a member of the European Economic Area |
| euMember |
✓ |
is a member of the European Union |
| esmMember |
✓ |
is a member of the European Single Market |
| altCurrency |
✓ |
complementary currency |
| isoShortNameByLanguage |
✗ |
Map for storing country short name by locale |
DistanceUnit(enum class)
| Parameter |
Nullable |
Description |
| wireName |
✗ |
Actual value from json |
GeoData
| Parameter |
Nullable |
Description |
| coordinate |
✗ |
center point of this country |
| maxCoordinate |
✗ |
the most northeast point of this country |
| minCoordinate |
✗ |
the most southwest point of this country |
| boundary |
✗ |
BoundingBox. bounding box of this country |
BoundingBox
| Parameter |
Nullable |
Description |
| northeast |
✗ |
the most northeast point of this country |
| southwest |
✗ |
the most southwest point of this country |
Coordinate
| Parameter |
Nullable |
Description |
| latitude |
✗ |
latitude is a geographic coordinate that specifies the north–south position of a point on the Earth's surface |
| longitude |
✗ |
longitude is a geographic coordinate that specifies the east–west position of a point on the Earth's surface |
VatRates
| Parameter |
Nullable |
Description |
| standard |
✗ |
standard rate |
| reduced |
✗ |
reduced rates |
| superReduced |
✓ |
super-reduced rate |
| parking |
✓ |
parking rate |
Continent(enum class)
| Parameter |
Nullable |
Description |
| wireName |
✗ |
Actual value from json |
Region(enum class)
| Parameter |
Nullable |
Description |
| wireName |
✗ |
Actual value from json |
Week(enum class)
| Parameter |
Nullable |
Description |
| wireName |
✗ |
Actual value from json |
WorldRegion(enum class)
| Parameter |
Nullable |
Description |
| wireName |
✗ |
Actual value from json |
SubdivisionGeoData
| Parameter |
Nullable |
Description |
| latitude |
✓ |
The latitude represent as the center point of subdivision |
| longitude |
✓ |
The longitude represent as the center point of subdivision |
| maxLatitude |
✓ |
The maximum latitude represent as the center point of subdivision |
| maxLongitude |
✓ |
The maximum longitude represent as the center point of subdivision |
| minLatitude |
✓ |
The minimum latitude represent as the center point of subdivision |
| minLongitude |
✓ |
The minimum longitude represent as the center point of subdivision |
Subdivision
| Parameter |
Nullable |
Description |
| name |
✗ |
The name of this subdivision |
| code |
✗ |
The code of this subdivision |
| geo |
✓ |
The GeoData info of this subdivision |
| translation |
✗ |
The translation map of this subdivision |
| type |
✗ |
The type of this subdivision |
Maintainer
Jack Liu