PluralRules class final

Determines the correct plural category for a number based on a locale.

This can be used to select the correct localized string (e.g., "1 cat" vs. "2 cats").

Constructors

PluralRules({Locale? locale, PluralType type = PluralType.cardinal, Digits? digits, RoundingMode roundingMode = RoundingMode.halfExpand, int minimumIntegerDigits = 1, TrailingZeroDisplay trailingZeroDisplay = TrailingZeroDisplay.auto})
Creates a new plural rules selector.

Properties

hashCode → int
The hash code for this object.
no setterinherited
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
select<T extends Object?>(num count, {T? zero, T? one, T? two, T? few, T? many, required T other}) → T
Returns the appropriate plural form for count among the options.
toString() → String
A string representation of this object.
inherited

Operators

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