AppLocale enum

Supported locales, see extension methods below.

Usage:

  • LocaleSettings.setLocale(AppLocale.en) // set locale
  • Locale locale = AppLocale.en.flutterLocale // get flutter locale from enum
  • if (LocaleSettings.currentLocale == AppLocale.en) // locale check
Inheritance
Mixed-in types
Available extensions

Values

en → const AppLocale
const AppLocale(languageCode: 'en', build: StringsEn.build)
ru → const AppLocale
const AppLocale(languageCode: 'ru', build: StringsRu.build)

Properties

build TranslationBuilder<AppLocale, StringsEn>
Gets a new translation instance. LocaleSettings has no effect here. Suitable for dependency injection and unit tests.
final
countryCode String?
final
hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
languageCode String
final
languageTag String
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scriptCode String?
final
translations StringsEn
Gets current instance managed by LocaleSettings.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sameLocale(BaseAppLocale<BaseAppLocale, BaseTranslations> other) bool
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

values → const List<AppLocale>
A constant List of the values in this enum, in order of their declaration.