deleteLastChar method

void deleteLastChar()

删除最后一个字符

Implementation

void deleteLastChar() {
  final String content = text;
  if (content.isNotEmpty) {
    text = content.substring(0, content.length - 1);
    selection = TextSelection.collapsed(offset: text.length);
  }
}