LocalinoAsset class

Defines language and asset path to file with localization data.

Constructors

LocalinoAsset(String locale, String? path)
locale - It's preferred to use iso2 (en) or unicode (en_US) standard. path - Asset path to file with localization data (json).
const

Properties

hashCode int
The hash code for this object.
no setterinherited
iso2Locale String
Returns just first 2 signs of locale key.
no setter
isValid bool
Checks validity of locale and path
no setter
locale String
Locale key. It's preferred to use iso2 (en) or unicode (en_US) standard.
final
path String?
Asset path to file with localization data (json).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toLocale() Locale
Parses locale string to Locale. en - will be parse to Locale('en') en_US - will be parsed to Locale('en', 'US') en_US_419 - will be parsed to Locale('en', 'US_419')
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

list({String assets = _defaultAssetsLocation, required List<String> locales}) List<LocalinoAsset>
Builds a List of LocalinoAsset by providing asset path and list of locales. Default asset path is ./assets/localization/{locale}.json
map({String assets = _defaultAssetsLocation, required List<String> locales}) Map<String, String>
Builds a Map of {locale, path} by providing asset path and list of locales. Default asset path is ./assets/localization/{locale}.json
normalizeLocaleKey(String locale) String
Normalize localization identifier. en -> en en-US -> en_US en-US-419 -> en_US_419
normalizeLocaleTag(String locale) String
Normalize localization identifier. en -> en en_US -> en-US en_US_419 -> en-US-419

Constants

empty → const LocalinoAsset