Locale class

An identifier used to select a user's language and formatting preferences, consisting of a language and a country. This is a subset of locale identifiers as defined by BCP 47.

Locales are canonicalized according to the "preferred value" entries in the IANA Language Subtag Registry. For example, const Locale('he') and const Locale('iw') are equal and both have the languageCode he, because iw is a deprecated language subtag that was replaced by the subtag he.

See also:

  • Window.locale, which specifies the system's currently selected Locale.


Locale(String _languageCode, [ String _countryCode ])
Creates a new Locale object. The first argument is the primary language subtag, the second is the region subtag. [...]


countryCode → String
The region subtag for the locale. [...]
hashCode → int
The hash code for this object. [...]
languageCode → String
The primary language subtag for the locale. [...]
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited


toString() → String
Returns a string representation of this object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]


operator ==(dynamic other) → bool
The equality operator. [...]