clear editor (#505)

pull/515/head
Andy Trand 3 years ago committed by GitHub
parent e265b54b1b
commit 7d6319de5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      lib/src/widgets/controller.dart

@ -122,6 +122,13 @@ class QuillController extends ChangeNotifier {
bool get hasRedo => document.hasRedo;
/// clear editor
void clear() {
replaceText(
0, plainTextEditingValue.text.length-1, '',
TextSelection.collapsed(offset: 0));
}
void replaceText(
int index, int len, Object? data, TextSelection? textSelection,
{bool ignoreFocus = false}) {

Loading…
Cancel
Save