displayCurrent method Null safety

void displayCurrent(
  1. {bool flash = false,
  2. bool delayed = false}
)

Implementation

void displayCurrent({bool flash = false, bool delayed = false}) {
  final display = memory.model.display;
  final String newText;
  if (currentLine == 0) {
    newText = '000-      ';
  } else {
    String ls = currentLine.toRadixString(10).padLeft(3, '0');
    String disp = getCurrent().programDisplay.toLowerCase();
    newText = '$ls$disp';
  }
  if (delayed) {
    final initial = memory.model._newLcdContents();
    display.current = newText;
    final delayed = memory.model._newLcdContents();
    final t = Timer(const Duration(milliseconds: 1400), () {
      display.show(delayed);
    });
    delayed._myTimer = t;
    initial._myTimer = t;
    display.show(initial);
  } else {
    display.current = newText;
    display.update(flash: flash);
  }
}