BaseFlutterLocaleSettings<E extends BaseAppLocale<E, T>, T extends BaseTranslations<E, T>> class

Similar to BaseLocaleSettings but actually implements the updateProviderState method.

Inheritance
Implementers
Available extensions

Constructors

BaseFlutterLocaleSettings({required BaseAppLocaleUtils<E, T> utils})

Properties

currentLocale → E

Available on BaseLocaleSettings<E, T>, provided by the LocaleSettingsExt extension

Gets current locale.
no setter
currentTranslations → T

Available on BaseLocaleSettings<E, T>, provided by the LocaleSettingsExt extension

Gets current translations
no setter
hashCode int
The hash code for this object.
no setterinherited
listenToDeviceLocale bool
If true, then TranslationProvider will 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
supportedLocales List<Locale>

Available on BaseFlutterLocaleSettings<E, T>, provided by the ExtBaseLocaleSettings extension

Gets supported locales (as Locale objects) with base locale sorted first.
no setter
supportedLocalesRaw List<String>

Available on BaseLocaleSettings<E, T>, provided by the LocaleSettingsExt extension

Gets supported locales in string format.
no setter
translationMap Map<E, T>
Internal: Manages all translation instances May be modified when setting a custom plural resolver
finalinherited
utils BaseAppLocaleUtils<E, T>
Internal: Reference to utils instance
finalinherited

Methods

getLocaleStream() Stream<E>

Available on BaseLocaleSettings<E, T>, provided by the LocaleSettingsExt extension

Gets the broadcast stream to keep track of every locale change.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overrideTranslations({required E locale, required FileType fileType, required String content}) → void

Available on BaseLocaleSettings<E, T>, provided by the LocaleSettingsExt extension

Overrides existing translations of locale with new ones from content. The content should be formatted and structured exactly the same way as the original files.
overrideTranslationsFromMap({required E locale, required bool isFlatMap, required Map map}) → void

Available on BaseLocaleSettings<E, T>, provided by the LocaleSettingsExt extension

Overrides existing translations of locale with new ones from the map.
setLocale(E locale, {bool? listenToDeviceLocale = false}) → E

Available on BaseLocaleSettings<E, T>, provided by the LocaleSettingsExt extension

Sets locale. Returns the locale which has been set.
setLocaleRaw(String rawLocale, {bool? listenToDeviceLocale = false}) → E

Available on BaseLocaleSettings<E, T>, provided by the LocaleSettingsExt extension

Sets locale using string tag (e.g. en_US, de-DE, fr) Fallbacks to base locale. Returns the locale which has been set.
setPluralResolver({String? language, E? locale, PluralResolver? cardinalResolver, PluralResolver? ordinalResolver}) → void

Available on BaseLocaleSettings<E, T>, provided by the LocaleSettingsExt extension

Sets plural resolvers. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html See https://github.com/slang-i18n/slang/blob/main/slang/lib/api/plural_resolver_map.dart Either specify language, or locale. locale has precedence.
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.
override
useDeviceLocale() → E

Available on BaseFlutterLocaleSettings<E, T>, provided by the ExtBaseLocaleSettings extension

Uses locale of the device, fallbacks to base locale. Returns the locale which has been set.

Operators

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