reset method Null safety

  1. @override
void reset()
override

Reset the calculator to its default state.

Implementation

@override
void reset() {
  userMode = false;
  displayMode = DisplayMode.fix(4, false);
  super.reset();
  rand.reset();
  trigMode = TrigMode.deg;
  _resultMatrix = 0;
  for (final mat in matrices) {
    mat.resize(this, 0, 0);
  }
  memory.program.suspendedProgram?.abort();
  memory.program.suspendedProgram = null;
  assert(memory.program.runner == null);
  memory.program.runner?.abort(); // Should be null, but be conservative
  memory.program.runner = null;
  memory.numRegisters = 20;
}