backspace method

void backspace()

Delete the previous letter.

Implementation

void backspace() {
  if (text.isEmpty) {
    return outputText('Start of line.');
  }
  final char = text[text.length - 1];
  outputText('Deleted ${convertChar(char)}.');
  text = text.substring(0, text.length - 1);
}