Locale class

Representing a Unicode locale identifier. It is composed of the primary language subtag for the locale, the region (also referred to as 'country') subtag, and the script subtag.

Examples are de-DE, es-419, or zh-Hant-TW.

Constructors

Locale({required String language, String? region, String? script, Calendar? calendar, CaseFirst? caseFirst, String? collation, HourCycle? hourCycle, String? numberingSystem, bool? numeric})
const

Properties

calendar Calendar?
final
caseFirst CaseFirst?
final
collation String?
final
hashCode int
The hash code for this object.
no setteroverride
hourCycle HourCycle?
final
language String
The language subtag, such as en for English.
final
numberingSystem String?
final
numeric bool?
final
region String?
The region subtag, such as US for the United Status of America or 419 for Latin America.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
script String?
The script subtag, such as Hant for traditional chinese.
final

Methods

maximize() Locale
Try to add the most likely language, script, and region tags.
minimize() Locale
Try to remove tags which would be added by maximize.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toLanguageTag([String separator = '-']) String
Generate a language tag by joining the subtags with the separator.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

parse(String s) Locale
Parse a language tag by calling to web/ICU4X functionalities.