isTrue static method
Asserts that a boolean expression
is true.
Throws an InvalidArgumentException
with the given message
if the expression evaluates to false.
Example:
Assert.isTrue(age > 18, 'Age must be greater than 18');
Implementation
static void isTrue(bool expression, String message) {
if (!expression) {
throw InvalidArgumentException(message);
}
}