API-reference
API-reference
En komplet reference over alle offentlige API'er tilgaengelige i hver pakke.
Typer
Country
| Felt | Type | Beskrivelse |
|---|---|---|
id | string | Unik identifikator (f.eks. "unitedStates") |
alpha2Code | string | ISO 3166-1 alpha-2 (f.eks. "US") |
alpha3Code | string | ISO 3166-1 alpha-3 (f.eks. "USA") |
numericCode | number | ISO 3166-1 numerisk (f.eks. 840) |
nativeName | string | Oprindeligt landenavn |
capital | string | Hovedstad |
mainLanguage | string | Primaer sprogkode |
languages | string[] | Alle talte sprogkoder |
tld | string | Topdomaene |
callingCode | number | Internationalt opkaldsnummer |
continent | string | Kontinent-identifikator |
currency | string | Valutakode |
Language
| Felt | Type | Beskrivelse |
|---|---|---|
id | string | Unik identifikator (f.eks. "english") |
code | string | ISO 639-1-kode (f.eks. "en") |
nativeName | string | Navn paa selve sproget |
dialects | LanguageDialect[] | Regionale varianter |
defaultFlagCode | string? | Landekode for repraesentativt flag |
LanguageDialect
| Felt | Type | Beskrivelse |
|---|---|---|
id | string | Unik identifikator |
code | string | Dialektkode |
nativeName | string | Oprindeligt navn paa dialekten |
flagCode | string? | Landekode for dialektens flag |
Currency
| Felt | Type | Beskrivelse |
|---|---|---|
id | string | Unik identifikator (f.eks. "usd") |
code | string | ISO 4217-kode (f.eks. "USD") |
nativeName | string | Ental-navn (f.eks. "US Dollar") |
nativeNamePlural | string | Flertal-navn (f.eks. "US Dollars") |
symbol | string | Valutasymbol (f.eks. "$") |
Continent
| Felt | Type | Beskrivelse |
|---|---|---|
id | string | Unik identifikator (f.eks. "europe") |
code | string | Tobogstavskode (f.eks. "EU") |
name | string | Engelsk visningsnavn |
Opslagsfunktioner
Lande
// Dart
Country.fromAlpha2Code(String code) -> Country?
Country.fromAlpha3Code(String code) -> Country?
Country.fromNumericCode(int code) -> Country?
Country.values -> List<Country>
Continent.countries -> List<Country>Sprog
// Dart
Language.fromCode(String code) -> Language?
Language.values -> List<Language>Valutaer
// Dart
Currency.fromCode(String code) -> Currency?
Currency.values -> List<Currency>Kontinenter
// Dart
Continent.fromCode(String code) -> Continent?
Continent.values -> List<Continent>Flag
// Dart
countryFlags // Map<String, String>
country.flagSvg // String?
country.flag(shape: FlagShape, width: double, height: double) // WidgetEmoji-flag
// Dart
country.emojiFlag // StringEnums / Konstanter
Hver pakke tilbyder typesikre konstanter for alle koder:
// Dart — enums
Country.unitedStates
Language.french
Currency.eur
Continent.europeOversaettelsesfunktioner
Alle oversaettelsesfunktioner tager en enhedskode og en lokalitetskode og returnerer det lokaliserede navn.
Tilgaengelige lokaliteter: 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)Oversaettelsesmaps
For masseadgang er de raa oversaettelsesmaps tilgaengelige:
// Dart
CountriesTranslationsDelegate.translations
LanguagesTranslationsDelegate.translations
CurrenciesTranslationsDelegate.translations
ContinentsTranslationsDelegate.translations
CapitalsTranslationsDelegate.translations