AcceptLanguageEntry class

A parsed entry from an HTTP Accept-Language header or browser preferences with quality weighting.

Implements Comparable to sort entries in descending order of quality weight (quality), from highest preference (q=1.0) to lowest.

const entry = AcceptLanguageEntry('fr-FR', 0.9);
print(entry.tag); // "fr-FR"
print(entry.quality); // 0.9

See also:

Implemented types

Constructors

AcceptLanguageEntry(String tag, [double quality = 1.0])
Creates an AcceptLanguageEntry with tag and optional quality weighting (defaults to 1.0).
const

Properties

hashCode int
The hash code for this object.
no setterinherited
quality double
Quality value weight (q=) ranging between 0.0 and 1.0.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tag String
The BCP-47 language tag or subtag (e.g. 'fr', 'en-US').
final

Methods

compareTo(AcceptLanguageEntry other) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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