handleGosubEntryDone method Null safety

void handleGosubEntryDone(
  1. int label
)

When GSB

Implementation

void handleGosubEntryDone(int label) {
  // We know that we're coming from a keyboard-entered GSB, since arguments
  // are being input.
  if (label <= arg.maxArg) {
    final p = arg.pressed;
    if (p != null) {
      p(lastState as ActiveState);
    }
    assert(controller is RealController);
    final program = model.memory.program;
    program.resetReturnStack();
    try {
      program.gosub(label);
    } on CalculatorError catch (e) {
      changeState(lastState);
      controller.showCalculatorError(e);
      return;
    }
    program.displayCurrent();
    isDone = true;
    // On button up, another goto(label) will happen, but that's harmless.
  } else {
    super.done(label);
  }
}