pasteText method

  1. @override
Future<void> pasteText(
  1. SelectionChangedCause cause
)
override

Paste text from Clipboard.

If there is currently a selection, it will be replaced.

If and only if cause is SelectionChangedCause.toolbar, the toolbar will be hidden and the current selection will be scrolled into view.

Implementation

@override
Future<void> pasteText(SelectionChangedCause cause) async {
  clipboardController.paste(widget.controller, textEditingValue);
  if (cause == SelectionChangedCause.toolbar) {
    bringIntoView(textEditingValue.selection.extent);
    hideToolbar();
  }
}