API-referentie
API-referentie
Een volledig overzicht van alle publieke API's die beschikbaar zijn in elk pakket.
Typen
Country
| Veld | Type | Beschrijving |
|---|---|---|
id | string | Unieke identificatie (bijv. "unitedStates") |
alpha2Code | string | ISO 3166-1 alfa-2 (bijv. "US") |
alpha3Code | string | ISO 3166-1 alfa-3 (bijv. "USA") |
numericCode | number | ISO 3166-1 numeriek (bijv. 840) |
nativeName | string | Oorspronkelijke landnaam |
capital | string | Hoofdstad |
mainLanguage | string | Primaire taalcode |
languages | string[] | Alle gesproken taalcodes |
tld | string | Topniveaudomein |
callingCode | number | Internationaal landnummer |
continent | string | Continentidentificatie |
currency | string | Valutacode |
Language
| Veld | Type | Beschrijving |
|---|---|---|
id | string | Unieke identificatie (bijv. "english") |
code | string | ISO 639-1-code (bijv. "en") |
nativeName | string | Naam in de taal zelf |
dialects | LanguageDialect[] | Regionale varianten |
defaultFlagCode | string? | Landcode voor representatieve vlag |
LanguageDialect
| Veld | Type | Beschrijving |
|---|---|---|
id | string | Unieke identificatie |
code | string | Dialectcode |
nativeName | string | Oorspronkelijke naam van het dialect |
flagCode | string? | Landcode voor de vlag van het dialect |
Currency
| Veld | Type | Beschrijving |
|---|---|---|
id | string | Unieke identificatie (bijv. "usd") |
code | string | ISO 4217-code (bijv. "USD") |
nativeName | string | Enkelvoudige naam (bijv. "US Dollar") |
nativeNamePlural | string | Meervoudige naam (bijv. "US Dollars") |
symbol | string | Valutasymbool (bijv. "$") |
Continent
| Veld | Type | Beschrijving |
|---|---|---|
id | string | Unieke identificatie (bijv. "europe") |
code | string | Tweeletterige code (bijv. "EU") |
name | string | Engelse weergavenaam |
Opzoekfuncties
Landen
// 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
// Dart
Language.fromCode(String code) -> Language?
Language.values -> List<Language>Valuta's
// Dart
Currency.fromCode(String code) -> Currency?
Currency.values -> List<Currency>Continenten
// Dart
Continent.fromCode(String code) -> Continent?
Continent.values -> List<Continent>Vlaggen
// Dart
countryFlags // Map<String, String>
country.flagSvg // String?
country.flag(shape: FlagShape, width: double, height: double) // WidgetEmojivlaggen
// Dart
country.emojiFlag // StringEnums / Constanten
Elk pakket biedt typeveilige constanten voor alle codes:
// Dart — enums
Country.unitedStates
Language.french
Currency.eur
Continent.europeVertaalfuncties
Alle vertaalfuncties nemen een entiteitcode en een taalgebiedcode en retourneren de gelokaliseerde naam.
Beschikbare taalgebieden: 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)Vertaalmappen
Voor bulktoegang zijn de ruwe vertaalmappen beschikbaar:
// Dart
CountriesTranslationsDelegate.translations
LanguagesTranslationsDelegate.translations
CurrenciesTranslationsDelegate.translations
ContinentsTranslationsDelegate.translations
CapitalsTranslationsDelegate.translations