dropLastCharacter method

void dropLastCharacter()

Deletes the last character (custom keypad backspace). controller.dropLastCharacter()

Implementation

void dropLastCharacter() {
  if (text.isEmpty) return;
  final String updated = text.characters.skipLast(1).toString();
  value = TextEditingValue(
    text: updated,
    selection: TextSelection.collapsed(offset: updated.length),
  );
}