plural method Null safety
Formats a message differently depending on howMany
.
Selects the correct plural form from the provided alternatives.
The other
named argument is mandatory.
The precision
is the number of fractional digits that would be rendered
when howMany
is formatted. In some cases just knowing the numeric value
of howMany
itsef is not enough, for example "1 mile" vs "1.00 miles"
For an explanation of plurals and the zero
, one
, two
, few
, many
categories see http://cldr.unicode.org/index/cldr-spec/plural-rules
Implementation
@pragma('dart2js:tryInline')
@pragma('vm:prefer-inline')
static String plural(num howMany,
{String? zero,
String? one,
String? two,
String? few,
String? many,
required String other,
String? desc,
Map<String, Object>? examples,
String? locale,
int? precision,
String? name,
List<Object>? args,
String? meaning,
bool? skip}) {
// Call our internal method, dropping examples and desc because they're not
// used at runtime and we want them to be optimized away.
return _plural(howMany,
zero: zero,
one: one,
two: two,
few: few,
many: many,
other: other,
locale: locale,
precision: precision,
name: name,
args: args,
meaning: meaning);
}