toPluralFormForQuantity method

String toPluralFormForQuantity({
  1. required num quantity,
  2. bool includeQuantity = true,
  3. String? locale,
})

Converts this string to the appropriate plural form to describe the specified quantity, including the quantity in the returned result if includeQuantity is true.

Implementation

String toPluralFormForQuantity({
  required num quantity,
  bool includeQuantity = true,
  String? locale,
}) {
  final pluralized = quantity == 1
      ? toSingularForm(locale: locale)
      : toPluralForm(locale: locale);
  final result = '${includeQuantity ? '$quantity ' : ''}$pluralized';
  return result;
}