checkArgument function
Ensures the truth of an expression involving one or more parameters to the calling method.
Implementation
void checkArgument(bool condition, String errorMessage) {
if (!condition) {
throw ArgumentError(errorMessage);
}
}