plural method

Text plural(
  1. num value,
  2. {BuildContext? context,
  3. List<String>? args,
  4. Map<String, String>? namedArgs,
  5. String? name,
  6. NumberFormat? format}

function translate with pluralization key Localization key value Number value for pluralization BuildContext The location in the tree where this widget builds args List of localized strings. Replaces {} left to right namedArgs Map of localized strings. Replaces the name keys {key_name} according to its name name Name of number value. Replaces {$name} to value format Formats a numeric value using a NumberFormat class


  "day": {
    "zero":"{} дней",
    "one": "{} день",
    "two": "{} дня",
    "few": "{} дня",
    "many": "{} дней",
    "other": "{} дней"
  "money": {
    "zero": "You not have money",
    "one": "You have {} dollar",
    "many": "You have {} dollars",
    "other": "You have {} dollars"
  "money_args": {
    "zero": "{} has no money",
    "one": "{} has {} dollar",
    "many": "{} has {} dollars",
    "other": "{} has {} dollars"
  "money_named_args": {
    "zero": "{name} has no money",
    "one": "{name} has {money} dollar",
    "many": "{name} has {money} dollars",
    "other": "{name} has {money} dollars"
Text('money').plural(1000000, format: NumberFormat.compact(locale: context.locale.toString())) // output: You have 1M dollars
print('day'.plural(21)); // output: 21 день
var money = plural('money', 10.23) // output: You have 10.23 dollars
var money = plural('money_args', 10.23, args: ['John', '10.23'])  // output: John has 10.23 dollars
var money = plural('money_named_args', 10.23, namedArgs: {'name': 'Jane'}, name: 'money')  // output: Jane has 10.23 dollars


Text plural(
  num value, {
  BuildContext? context,
  List<String>? args,
  Map<String, String>? namedArgs,
  String? name,
  NumberFormat? format,
}) =>
          data ?? '',
          context: context,
          args: args,
          namedArgs: namedArgs,
          name: name,
          format: format,
        key: key,
        style: style,
        strutStyle: strutStyle,
        textAlign: textAlign,
        textDirection: textDirection,
        locale: locale,
        softWrap: softWrap,
        overflow: overflow,
        textScaler: textScaler,
        maxLines: maxLines,
        semanticsLabel: semanticsLabel,
        textWidthBasis: textWidthBasis);