checkState function

void checkState(
  1. bool condition,
  2. Object message
)

Implementation

void checkState(bool condition, Object message) {
  if (!condition) {
    throw StateError('$message');
  }
}