NmLocaleController class

Holds the user's language choice and persists it across sessions.

userLocale == null means "follow the system language".

Inheritance

Constructors

NmLocaleController({NmPrefsStore? store, String storageKey = 'nm.locale', List<String> legacyKeys = const [], Locale? initialLocale})
Creates an NmLocaleController.

Properties

hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
isLoaded → bool
Whether the saved choice has been read.
no setter
legacyKeys → List<String>
Keys older app versions used; migrated once into storageKey.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
storageKey → String
Where the choice is stored (BCP-47 tag).
final
userLocale → Locale?
The user's choice; null follows the system language.
no setter

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
dispose() → void
Discards any resources used by the object.
inherited
load() → Future<void>
Reads the saved choice (migrating a legacy key if needed).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
resolve(List<Locale> system, List<Locale> supported) → Locale
The locale to use given the system list and app-supported locales.
select(Locale? locale) → Future<void>
Sets the language; null returns to the system language.
toString() → String
A string representation of this object.
inherited

Operators

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