checkArgument static method

void checkArgument(
  1. Object argument,
  2. bool expression,
  3. String name,
  4. String message,
)

If expression does not evaluate to true throws an ArgumentError using the given argument, name and message.

Implementation

static void checkArgument(
    Object argument, bool expression, String name, String message) {
  if (!expression) {
    throw ArgumentError.value(argument, name, message);
  }
}