Countries
Countries
The package includes 248+ countries with full ISO 3166-1 metadata.
Country Properties
Each country has the following fields:
| Field | Description |
|---|---|
alpha2Code | ISO 3166-1 alpha-2 code (e.g. "US") |
alpha3Code | ISO 3166-1 alpha-3 code (e.g. "USA") |
numericCode | ISO 3166-1 numeric code (e.g. 840) |
nativeName | Native country name |
capital | Capital city |
mainLanguage | Primary language code |
languages | List of spoken language codes |
tld | Top-level domain (e.g. ".us") |
callingCode | International calling code (e.g. 1) |
continent | Continent identifier |
currency | Primary currency code |
Lookup by Code
Alpha-2 Code
final country = Country.fromAlpha2Code('US');
print(country?.nativeName); // United States
print(country?.capital); // Washington, D.C.Alpha-3 Code
final country = Country.fromAlpha3Code('USA');
print(country?.alpha2Code); // USNumeric Code (Dart only)
final country = Country.fromNumericCode(840);
print(country?.nativeName); // United States
List All Countries
final allCountries = Country.values;
print(allCountries.length); // 253Filter by Continent
final european = Continent.europe.countries;
for (final c in european) {
print(c.nativeName);
}SVG Flags
Each country has an inline SVG flag available as a string.
// Access via the countryFlags map
final svg = countryFlags['US'];
// Or via the Country property
final country = Country.fromAlpha2Code('US');
final flagSvg = country?.flagSvg;
// Render as a Flutter widget
country?.flag(
shape: FlagShape.rectangle,
width: 32,
height: 24,
);Emoji Flags
final country = Country.fromAlpha2Code('US');
print(country?.emojiFlag);Country Metadata
final country = Country.fromAlpha2Code('JP');
print(country?.callingCode); // 81
print(country?.tld); // .jp
print(country?.currency.code); // JPY
print(country?.continent.code); // AS
print(country?.mainLanguage.code); // ja