quillUpdateEditingValue method

Future<void> quillUpdateEditingValue(
  1. Finder finder,
  2. String text
)

Update the text editing value of the QuillEditor widget specified by finder with text, as if it had been provided by the onscreen keyboard.

The widget specified by finder must already have focus and be a QuillEditor or have a QuillEditor descendant. For example find.byType(QuillEditor).

Implementation

Future<void> quillUpdateEditingValue(Finder finder, String text) async {
  return TestAsyncUtils.guard(() async {
    final editor = state<QuillRawEditorState>(
      find.descendant(
        of: finder,
        matching:
            find.byType(QuillRawEditor, skipOffstage: finder.skipOffstage),
        matchRoot: true,
      ),
    );
    testTextInput.updateEditingValue(
      TextEditingValue(
        text: text,
        selection: TextSelection.collapsed(
            offset: editor.textEditingValue.text.length),
      ),
    );
    await idle();
  });
}