PluralRules constructor
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.
locale: The locale defining the pluralization rules. Ifnull, uses the system locale.type: Specifies if the rules are for cardinal numbers (counting, e.g., '1 dog') or ordinal numbers (ordering, e.g., '1st', '2nd'). Defaults to PluralType.cardinal.- Number formatting parameters (
digits,roundingMode, etc.) configure how the number is handled before applying the pluralization logic.
Implementation
PluralRules({
Locale? locale,
PluralType type = PluralType.cardinal,
Digits? digits,
RoundingMode roundingMode = RoundingMode.halfExpand,
int minimumIntegerDigits = 1,
TrailingZeroDisplay trailingZeroDisplay = TrailingZeroDisplay.auto,
}) : _pluralRulesImpl = PluralRulesImpl.build(
locale ?? findSystemLocale(),
PluralRulesOptions(
digits: digits,
minimumIntegerDigits: minimumIntegerDigits,
roundingMode: roundingMode,
trailingZeroDisplay: trailingZeroDisplay,
type: type,
),
);