requireExactArgs static method

void requireExactArgs(
  1. List<Object?> positional,
  2. int count,
  3. String methodName
)

Verify exact positional arguments count.

Throws ArgumentError if wrong number of arguments.

Implementation

static void requireExactArgs(
  List<Object?> positional,
  int count,
  String methodName,
) {
  if (positional.length != count) {
    throw ArgumentD4rtException(
      '$methodName expects exactly $count argument(s), got ${positional.length}',
    );
  }
}