wrongNumberOfArgumentsError function

String wrongNumberOfArgumentsError(
  1. int argumentsCount,
  2. int expectedArgumentsCount,
  3. String type
)

Implementation

String wrongNumberOfArgumentsError(int argumentsCount, int expectedArgumentsCount, String type) {
  return Intl.message(
    Intl.plural(
      argumentsCount,
      zero: Intl.plural(
        expectedArgumentsCount,
        one: "The type '$type' expects one argument, but none was provided.",
        other: "The type '$type' expects $expectedArgumentsCount arguments, but none was provided.",
      ),
      one: Intl.plural(
        expectedArgumentsCount,
        zero: "The type '$type' don't accept arguments, but an argument was provided.",
        other: "The type '$type' expects $expectedArgumentsCount arguments, but an was provided.",
      ),
      other: Intl.plural(
        expectedArgumentsCount,
        zero: "The type '$type' don't accept arguments, but $argumentsCount arguments were provided.",
        one: "The type '$type' expects one argument, but $argumentsCount arguments were provided.",
        other: "The type '$type' expects $expectedArgumentsCount, but $argumentsCount arguments were provided.",
      ),
    ),
    name: 'wrongNumberOfArgumentsErrorMessage',
    args: [argumentsCount, expectedArgumentsCount, type],
    desc: 'The error message for when the number of type arguments passed to a type is different than the expected.',
  );
}