API Reference

API Reference

A complete reference of all public APIs available in each package.

Types

Country

FieldTypeDescription
idstringUnique identifier (e.g. "unitedStates")
alpha2CodestringISO 3166-1 alpha-2 (e.g. "US")
alpha3CodestringISO 3166-1 alpha-3 (e.g. "USA")
numericCodenumberISO 3166-1 numeric (e.g. 840)
nativeNamestringNative country name
capitalstringCapital city
mainLanguagestringPrimary language code
languagesstring[]All spoken language codes
tldstringTop-level domain
callingCodenumberInternational calling code
continentstringContinent identifier
currencystringCurrency code

Language

FieldTypeDescription
idstringUnique identifier (e.g. "english")
codestringISO 639-1 code (e.g. "en")
nativeNamestringName in the language itself
dialectsLanguageDialect[]Regional variations
defaultFlagCodestring?Country code for representative flag

LanguageDialect

FieldTypeDescription
idstringUnique identifier
codestringDialect code
nativeNamestringNative name of the dialect
flagCodestring?Country code for the dialect's flag

Currency

FieldTypeDescription
idstringUnique identifier (e.g. "usd")
codestringISO 4217 code (e.g. "USD")
nativeNamestringSingular name (e.g. "US Dollar")
nativeNamePluralstringPlural name (e.g. "US Dollars")
symbolstringCurrency symbol (e.g. "$")

Continent

FieldTypeDescription
idstringUnique identifier (e.g. "europe")
codestringTwo-letter code (e.g. "EU")
namestringEnglish display name

Lookup Functions

Countries

GoDartTypeScriptphp
// 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

GoDartTypeScriptphp
// Dart
Language.fromCode(String code) -> Language?
Language.values -> List<Language>

Currencies

GoDartTypeScriptphp
// Dart
Currency.fromCode(String code) -> Currency?
Currency.values -> List<Currency>

Continents

GoDartTypeScriptphp
// Dart
Continent.fromCode(String code) -> Continent?
Continent.values -> List<Continent>

Flags

GoDartTypeScriptphp
// Dart
countryFlags  // Map<String, String>
country.flagSvg  // String?
country.flag(shape: FlagShape, width: double, height: double)  // Widget

Emoji Flags

GoDartTypeScriptphp
// Dart
country.emojiFlag  // String

Enums / Constants

Each package provides type-safe constants for all codes:

GoDartTypeScriptphp
// Dart — enums
Country.unitedStates
Language.french
Currency.eur
Continent.europe

Translation 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

GoDartTypeScriptphp
// 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:

GoDartTypeScriptphp
// Dart
CountriesTranslationsDelegate.translations
LanguagesTranslationsDelegate.translations
CurrenciesTranslationsDelegate.translations
ContinentsTranslationsDelegate.translations
CapitalsTranslationsDelegate.translations