isTrue method

void isTrue([
  1. String? what
])

Check if value is true or not.

If not then it returns InvariantException.

Implementation

void isTrue([String? what]) {
  if (value is bool) {
    if (value as bool) {
      return;
    }
  }

  throw InvariantException('is-not-true', what);
}