TGLocale class Null safety

Supported, default and current locale holders with locale related supporting features

Constructors

TGLocale()

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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

Static Properties

currentLocale Locale
read / write
defaultLocale Locale
read / write
localizations Map<String, TGLocalization>
read / write
supportedLocales Iterable<Locale>
read / write

Static Methods

findLocaleByCode(String code) Locale
Find locale from supported list based on provided code. i.e. Locale ("en", "US") = "en_US"
generateCode(Locale locale) String
Generate code for provided locale
init({required Locale defaultLocale, List<Locale>? otherLocales}) → void
Initialize Localization (i18n) implementation
loadLocales() → void
localeResolutionCallback(Locale? locale, Iterable<Locale> supportedLocales) Locale?
Callback for locale resolution
text(String key, {List<String>? args}) String
Text value of provided key with optional args which replaces each {index}