NamedLocale class
A class representing a named locale for user selection.
This class is used to display a list of supported UiLanguages and allows the user to choose one of them.
Use NamedLocale to create instances that pair a user-friendly name with a corresponding Locale.
final namedLocale = NamedLocale(name: 'English',
locale: Locale('en', 'US'));
@ai When using this class, ensure to provide meaningful names for better user experience.
- Annotations
Constructors
- NamedLocale({required String name, required Locale locale})
-
Creates a NamedLocale instance.
const
Properties
- code → String
-
The language code of the locale.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- locale → Locale
-
The locale used as the value to change the application's locale.
final
- name → String
-
The display name of the locale shown to the user.
final
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stringify → bool?
-
If set to
true
, thetoString
method will be overridden to output this instance'sprops
.no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String - A string representation of this object.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited