assertion function

void assertion(
  1. bool value, [
  2. String? msg
])

Asserts if the value value is true or not

Throws AssertionException if false

Implementation

void assertion(bool value, [String? msg]) {
  if (!value) {
    throw AssertionException(msg ?? 'Assertion Error occured.');
  }
}