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

Constructors

AppLocale({required String languageCode, String? scriptCode, String? countryCode, required TranslationBuilder<AppLocale, _StringsEn> build})
const

Values

en → const AppLocale
AppLocale(languageCode: 'en', build: _StringsEn.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.
read-onlyinherited
index int
A numeric identifier for the enumerated value.
read-onlyinherited
languageCode String
final
languageTag String
read-onlyinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
scriptCode String?
final
translations → _StringsEn
Gets current instance managed by LocaleSettings.
read-only

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.
[en]