ActiveLocale class abstract final

Process-wide active Locale. Updated by each controller's setLocale, read by ICU plural/select expansion and by RTL/text-direction helpers that need to know the current language without depending on a specific controller.

Reading is cheap and synchronous; if no controller has set the locale yet, it falls back to the platform locale.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
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.
inherited

Operators

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

Static Properties

current Locale
The currently active locale. Falls back to WidgetsBinding.instance.platformDispatcher.locale when no controller has called set yet.
no setter

Static Methods

resetForTesting() → void
Test seam — clears the cached locale so a subsequent read falls back to the platform locale again.
set(Locale locale) → void
Called by each controller's setLocale. Apps don't normally call this directly — drive your controller and the controller updates this for you.