CollationOptions class
Collation allows users to specify language-specific rules for string comparison, such as rules for lettercase and accent marks. @Since(3.4)
Constructors
- CollationOptions(String locale, {int? strength, bool caseLevel = false, String? caseFirst, bool numericOrdering = false, String? alternate, String? maxVariable, bool backwards = false, bool normalization = false})
-
CollationOptions.fromMap(Map<
String, Object> collationMap) -
A constructor that accepts a Map with the following schema:
{
locale:
factory
Properties
- alternate ↔ String?
-
Field that determines whether collation should consider whitespace and
punctuation as base characters for purposes of comparison.
Possible values are:
getter/setter pair
- backwards ↔ bool
-
Flag that determines whether strings with diacritics sort from back
of the string, such as with some French dictionary ordering.
If true, compare from back to front.
If false, compare from front to back.
The default value is false.
getter/setter pair
- caseFirst ↔ String?
-
A field that determines sort order of case differences during tertiary level comparisons.
Possible values are:
getter/setter pair
- caseLevel ↔ bool
-
Flag that determines whether to include case comparison at strength
level 1 or 2. If true, include case comparison; i.e.
When used with strength:1, collation compares base characters and case.
When used with strength:2, collation compares base characters,
diacritics (and possible other secondary differences) and case.
If false, do not include case comparison at level 1 or 2.
The default is false.
For more information, see ICU Collation: Case Level.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- locale → String
-
The ICU locale.
See Supported Languages and Locales
for a list of supported locales.
final
- maxVariable ↔ String?
-
Field that determines up to which characters are considered ignorable
when alternate: "shifted". Has no effect if alternate: "non-ignorable"
Possible values are:
getter/setter pair
- normalization ↔ bool
-
Flag that determines whether to check if text require normalization and
to perform normalization. Generally, majority of text does not require
this normalization processing.
If true, check if fully normalized and perform normalization to compare
text.
If false, does not check.
The default value is false.
See
for details
getter/setter pair
- numericOrdering ↔ bool
-
Flag that determines whether to compare numeric strings as numbers or
as strings.
If true, compare as numbers; i.e. "10" is greater than "2".
If false, compare as strings; i.e. "10" is less than "2".
Default is false.
getter/setter pair
-
options
→ Map<
String, Object> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- strength ↔ int?
-
The level of comparison to perform.
Corresponds to ICU Comparison Levels.
Possible values are: 1, 2, 3, 4, 5
getter/setter pair
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