BaseLocaleSettings<E extends BaseAppLocale<T>, T extends BaseTranslations> class abstract

Available extensions

Constructors

BaseLocaleSettings.new({required List<E> locales, required E baseLocale, required BaseAppLocaleUtils<E, T> utils})

Properties

baseLocale → E
The base locale
final
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
locales List<E>
Locale enums sorted alphabetically and base locale first
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
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
final
utils BaseAppLocaleUtils<E, T>
Internal: Reference to utils instance
final

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
setLocale(E locale) → E

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

Sets locale, but do not change potential TranslationProvider's state Useful when you are in a pure Dart environment (without Flutter) This will be overwritten when using with flutter.
setLocaleRaw(String rawLocale) → 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://unicode-org.github.io/cldr-staging/charts/latest/supplemental/language_plural_rules.html See https://github.com/Tienisto/slang/blob/master/slang/lib/api/plural_resolver_map.dart Either specify language, or locale. locale has precedence.
toString() String
A string representation of this object.
inherited

Operators

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