MultiLanguage
A multilingual text value backed by a map of language codes to strings.
Requires a 'default' key. Use defaultValue to get the default text,
or getLanguage to get text for a specific language code.
Constructors
MultiLanguage.new
MultiLanguage.new(Map<String, String> data)Creates a MultiLanguage from a map that must contain a ‘default’ key.
MultiLanguage.fromJson
MultiLanguage.fromJson(Map<String, dynamic> json)factory
Properties
| Property | Type | Description |
|---|---|---|
defaultValue | String | Returns the default text value. (no setter) |
Methods
getLanguage
getLanguage(String language) → StringReturns the text for the given language code, falling back to defaultValue if the language is not available.
toJson
toJson() → Map<String, dynamic>Last updated on