LocaleSettings class
Manages all translation instances and the current locale
- Inheritance
-
- Object
- BaseLocaleSettings<
AppLocale, Translations> - LocaleSettings
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- lazy → bool
-
If true, then only the base locale is loaded initially.
Secondary locales are loaded on demand:
finalinherited
- listenToDeviceLocale ↔ bool
-
If true, then
TranslationProviderwill trigger setLocale on device locale change (e.g. due to user interaction in device settings).getter/setter pairinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
translationMap
→ Map<
AppLocale, Translations> -
Internal: Manages all translation instances.
The base locale is always included.
Additional locales are added when calling loadLocale.
May be modified when setting a custom plural resolver.
finalinherited
-
translationsLoading
→ Set<
AppLocale> -
Internal:
Keeps track of loading translations to prevent multiple requests.
This lock is sufficient because Dart's async loop is single-threaded.
finalinherited
-
utils
→ BaseAppLocaleUtils<
AppLocale, Translations> -
Internal: Reference to utils instance
finalinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateProviderState(
BaseAppLocale< BaseAppLocale, BaseTranslations> locale) → void -
Updates the provider state and therefore triggers a rebuild
on all widgets listening to this provider.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- currentLocale → AppLocale
-
no setter
- instance → LocaleSettings
-
final
Static Methods
-
getLocaleStream(
) → Stream< AppLocale> -
setLocale(
AppLocale locale, {bool? listenToDeviceLocale = false}) → Future< AppLocale> -
setLocaleRaw(
String rawLocale, {bool? listenToDeviceLocale = false}) → Future< AppLocale> -
setLocaleRawSync(
String rawLocale, {bool? listenToDeviceLocale = false}) → AppLocale -
setLocaleSync(
AppLocale locale, {bool? listenToDeviceLocale = false}) → AppLocale -
setPluralResolver(
{String? language, AppLocale? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) → Future< void> -
setPluralResolverSync(
{String? language, AppLocale? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) → void