API-referentie

API-referentie

Een volledig overzicht van alle publieke API's die beschikbaar zijn in elk pakket.

Typen

Country

VeldTypeBeschrijving
idstringUnieke identificatie (bijv. "unitedStates")
alpha2CodestringISO 3166-1 alfa-2 (bijv. "US")
alpha3CodestringISO 3166-1 alfa-3 (bijv. "USA")
numericCodenumberISO 3166-1 numeriek (bijv. 840)
nativeNamestringOorspronkelijke landnaam
capitalstringHoofdstad
mainLanguagestringPrimaire taalcode
languagesstring[]Alle gesproken taalcodes
tldstringTopniveaudomein
callingCodenumberInternationaal landnummer
continentstringContinentidentificatie
currencystringValutacode

Language

VeldTypeBeschrijving
idstringUnieke identificatie (bijv. "english")
codestringISO 639-1-code (bijv. "en")
nativeNamestringNaam in de taal zelf
dialectsLanguageDialect[]Regionale varianten
defaultFlagCodestring?Landcode voor representatieve vlag

LanguageDialect

VeldTypeBeschrijving
idstringUnieke identificatie
codestringDialectcode
nativeNamestringOorspronkelijke naam van het dialect
flagCodestring?Landcode voor de vlag van het dialect

Currency

VeldTypeBeschrijving
idstringUnieke identificatie (bijv. "usd")
codestringISO 4217-code (bijv. "USD")
nativeNamestringEnkelvoudige naam (bijv. "US Dollar")
nativeNamePluralstringMeervoudige naam (bijv. "US Dollars")
symbolstringValutasymbool (bijv. "$")

Continent

VeldTypeBeschrijving
idstringUnieke identificatie (bijv. "europe")
codestringTweeletterige code (bijv. "EU")
namestringEngelse weergavenaam

Opzoekfuncties

Landen

GoDartTypeScript
// Dart
Country.fromAlpha2Code(String code) -> Country?
Country.fromAlpha3Code(String code) -> Country?
Country.fromNumericCode(int code) -> Country?
Country.values -> List<Country>
Continent.countries -> List<Country>

Talen

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

Valuta's

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

Continenten

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

Vlaggen

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

Emojivlaggen

GoDartTypeScript
// Dart
country.emojiFlag  // String

Enums / Constanten

Elk pakket biedt typeveilige constanten voor alle codes:

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

Vertaalfuncties

Alle vertaalfuncties nemen een entiteitcode en een taalgebiedcode en retourneren de gelokaliseerde naam.

Beschikbare taalgebieden: da, de, en, es, fr, it, zh

GoDartTypeScript
// 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)

Vertaalmappen

Voor bulktoegang zijn de ruwe vertaalmappen beschikbaar:

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