assertThat function

void assertThat(
  1. bool isConditionMet, [
  2. String message = _kDefaultAssertionMessage
])

Assert with message (only in debug if desired). Roadmap #205. Audited: 2026-06-12 11:26 EDT

Implementation

void assertThat(bool isConditionMet, [String message = _kDefaultAssertionMessage]) {
  if (!isConditionMet) throw AssertionError(message);
}