LocalizedMap class
A class representing a localized map of values for different languages.
This class is used to manage localized strings associated with different UiLanguages.
- Annotations
Constructors
-
LocalizedMap({required Map<
UiLanguage, String> value}) -
const
-
LocalizedMap.fromJson(Map<
String, dynamic> json) -
Creates a LocalizedMap from a JSON map.
factory
-
LocalizedMap.fromJsonValueMap(Map<
String, dynamic> json) -
Creates a LocalizedMap from a JSON value map.
factory
- LocalizedMap.fromLanguages()
-
Creates a LocalizedMap initialized with empty values for all languages.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
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 -
value
→ Map<
UiLanguage, String> -
final
Methods
-
copyWith(
{Map< UiLanguage, String> ? value}) → LocalizedMap -
getValue(
Locale locale) → String - Retrieves the localized value for a given Locale.
-
getValueByLanguage(
[UiLanguage? language]) → String - Retrieves the localized value for a given UiLanguage.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String - A string representation of this object.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getCurrentLanguage(
) → UiLanguage - Retrieves the current language based on the locale.
-
toJsonValueMap(
LocalizedMap map) → Map< String, dynamic> - Converts the LocalizedMap to a JSON value map.
Constants
- empty → const LocalizedMap
- An empty LocalizedMap.