cutSelection method

  1. @override
void cutSelection(
  1. SelectionChangedCause cause
)
override

Cut current selection to Clipboard.

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

Implementation

@override
void cutSelection(SelectionChangedCause cause) {
  final plainText = textEditingValue.text;
  clipboardController.cut(widget.controller, plainText);
  if (cause == SelectionChangedCause.toolbar) {
    bringIntoView(textEditingValue.selection.extent);
    hideToolbar();
  }
}