setFlag method Null safety

void setFlag(
  1. int i,
  2. bool v
)

Implementation

void setFlag(int i, bool v) {
  if (i >= _flags.length) {
    throw CalculatorError(1);
  }
  _flags[i] = v;
  display.update();
  needsSave = true;
}