toIntOrThrow method

int toIntOrThrow()

converts to int without clamping. Throws if invalid

Implementation

int toIntOrThrow() {
  if (isValidInt) {
    return toInt();
  }

  throw RangeError('$this is not a valid [int]');
}