checkIndices method Null safety

void checkIndices(
  1. int row,
  2. int col
)

Implementation

void checkIndices(int row, int col) {
  if (row < 0 || col < 0 || row >= rows || col >= columns) {
    throw CalculatorError(3);
  }
}