isTrue static method

void isTrue(
  1. bool condition, [
  2. String? message
])

Asserts that the condition is true

Implementation

static void isTrue(bool condition, [String? message]) {
  if (!condition) {
    throw AssertionError(message ?? 'Assertion failed');
  }
}