LocaleMatcher enum

Used to find the best match between a user's desired locales and an application's supported locales.

When receiving a list of locales for which there is no perfect match in the list of supported locales, it is probably not the best solution to return null or an empty string. Instead, the application "falls back" until it finds a matching language tag associated with a suitable piece of content to insert. The exact fallback algorithm is determined by this enum.

Inheritance

Constructors

LocaleMatcher([String? _jsName])
const

Values

lookup → const LocaleMatcher

See the algorithm in https://datatracker.ietf.org/doc/html/rfc4647#section-3.4.

bestfit → const LocaleMatcher

A matcher lets the runtime provide a locale that's at least, but possibly more, suited for the request than the result of the lookup algorithm.

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
jsName String?
no setter
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

Constants

values → const List<LocaleMatcher>
A constant List of the values in this enum, in order of their declaration.