checkState function

void checkState (bool expression, { dynamic message })

Throws a StateError if the given expression is false.

Implementation

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