Locale class abstract

A representation of a Unicode Locale Identifier.

To create Locale instances, consider using:

  • fromSubtags for language, script and region,
  • parse for Unicode Locale Identifier strings (throws exceptions on failure),
  • tryParse for Unicode Locale Identifier strings (returns null on failure).

Constructors

Locale()

Properties

countryCode String?
The region subtag of the Locale Identifier, null if absent.
no setter
hashCode int
The hash code for this object.
no setteroverride
languageCode String
The language subtag of the Locale Identifier.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scriptCode String?
The script subtag of the Locale Identifier, null if absent.
no setter
variants Iterable<String>
Iterable of variant subtags.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toLanguageTag() String
Returns the canonical Unicode BCP47 Locale Identifier for this locale.
toString() String
Returns the canonical Unicode BCP47 Locale Identifier for this locale.
override

Operators

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

Static Methods

fromSubtags({required String languageCode, String? scriptCode, String? countryCode}) Locale
Constructs a Locale instance that consists of only language, script and region subtags.
parse(String localeIdentifier) Locale
Parses Unicode Locale Identifiers to produce Locale instances.
tryParse(String localeIdentifier) Locale?
Parses Unicode Locale Identifiers to produce Locale instances.