buttonUp method Null safety

  1. @override
void buttonUp()
override

Finish the operation started by buttonDown. This is meaningful for some keys, like SST, show-hex and clear-prefix.

Implementation

@override
void buttonUp() {
  try {
    if (doDeferred()) {
      model.display.displayX();
    }
  } on CalculatorError catch (e, s) {
    showCalculatorError(e, s);
    // ignore: avoid_catches_without_on_clauses
  } catch (e, s) {
    debugPrint('Unexpected exception $e\n\n$s');
    showCalculatorError(CalculatorError(9), s);
  }
  super.buttonUp();
}