getPluralCategory<T> method
T
getPluralCategory<T>({})
Determines the plural category of this number based on the current locale.
This uses the Intl.pluralLogic function to categorize the number into
one of the following: 'zero', 'one', 'two', 'few', 'many', or 'other'.
Arguments:
other: A default value to return if none of the specific plural forms match.zero,one,two,few,many: Values to return for specific plural forms (optional).locale,precision,meaning: Optional parameters to customize the pluralization rules (seeIntl.pluralLogicdocumentation).useExplicitNumberCases: Iftrue, number cases (e.g., "1") are passed toIntl.pluralLogic. Iffalse, only the number's value is passed.
Implementation
T getPluralCategory<T>({
required T other,
T? zero,
T? one,
T? two,
T? few,
T? many,
String? locale,
int? precision,
String? meaning,
bool useExplicitNumberCases = true,
}) =>
Intl.pluralLogic(
this,
zero: zero,
one: one,
two: two,
few: few,
many: many,
other: other,
locale: locale,
precision: precision,
meaning: meaning,
useExplicitNumberCases: useExplicitNumberCases,
);