API Reference
API Reference
A complete reference of all public APIs available in each package.
Types
Country
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier (e.g. "unitedStates") |
alpha2Code | string | ISO 3166-1 alpha-2 (e.g. "US") |
alpha3Code | string | ISO 3166-1 alpha-3 (e.g. "USA") |
numericCode | number | ISO 3166-1 numeric (e.g. 840) |
nativeName | string | Native country name |
capital | string | Capital city |
mainLanguage | string | Primary language code |
languages | string[] | All spoken language codes |
tld | string | Top-level domain |
callingCode | number | International calling code |
continent | string | Continent identifier |
currency | string | Currency code |
Language
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier (e.g. "english") |
code | string | ISO 639-1 code (e.g. "en") |
nativeName | string | Name in the language itself |
dialects | LanguageDialect[] | Regional variations |
defaultFlagCode | string? | Country code for representative flag |
LanguageDialect
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier |
code | string | Dialect code |
nativeName | string | Native name of the dialect |
flagCode | string? | Country code for the dialect's flag |
Currency
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier (e.g. "usd") |
code | string | ISO 4217 code (e.g. "USD") |
nativeName | string | Singular name (e.g. "US Dollar") |
nativeNamePlural | string | Plural name (e.g. "US Dollars") |
symbol | string | Currency symbol (e.g. "$") |
Continent
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier (e.g. "europe") |
code | string | Two-letter code (e.g. "EU") |
name | string | English display name |
Lookup Functions
Countries
// Dart
Country.fromAlpha2Code(String code) -> Country?
Country.fromAlpha3Code(String code) -> Country?
Country.fromNumericCode(int code) -> Country?
Country.values -> List<Country>
Continent.countries -> List<Country>Languages
// Dart
Language.fromCode(String code) -> Language?
Language.values -> List<Language>Currencies
// Dart
Currency.fromCode(String code) -> Currency?
Currency.values -> List<Currency>Continents
// Dart
Continent.fromCode(String code) -> Continent?
Continent.values -> List<Continent>Flags
// Dart
countryFlags // Map<String, String>
country.flagSvg // String?
country.flag(shape: FlagShape, width: double, height: double) // WidgetEmoji Flags
// Dart
country.emojiFlag // StringEnums / Constants
Each package provides type-safe constants for all codes:
// Dart — enums
Country.unitedStates
Language.french
Currency.eur
Continent.europeTranslation Functions
All translation functions take an entity code and a locale code, returning the localized name.
Available locales: da, de, en, es, fr, it, zh
// Dart — via entity instances
country.displayName(BuildContext context) // uses app locale
country.displayNameFromLocale(Locale locale)
country.displayCapitalFromLocale(Locale locale)
language.displayNameFromLocale(Locale locale)
currency.displayNameFromLocale(Locale locale)
continent.displayNameFromLocale(Locale locale)Translation Maps
For bulk access, raw translation maps are available:
// Dart
CountriesTranslationsDelegate.translations
LanguagesTranslationsDelegate.translations
CurrenciesTranslationsDelegate.translations
ContinentsTranslationsDelegate.translations
CapitalsTranslationsDelegate.translations