checkState function

void checkState(
  1. bool expression, {
  2. dynamic message,
})

Throws a StateError if the given expression is false.

Implementation

void checkState(bool expression, {message}) {
  if (!expression) {
    throw StateError(_resolveMessage(message, 'failed precondition')!);
  }
}