clipboardSelection method

bool clipboardSelection(
  1. bool copy
)

Implementation

bool clipboardSelection(bool copy) {
  copiedImageUrl = null;
  _pastePlainText = getPlainText();
  _pasteStyleAndEmbed = getAllIndividualSelectionStylesAndEmbed();

  if (!selection.isCollapsed) {
    Clipboard.setData(ClipboardData(text: _pastePlainText));
    if (!copy) {
      if (readOnly) return false;
      final sel = selection;
      replaceText(sel.start, sel.end - sel.start, '',
          TextSelection.collapsed(offset: sel.start));
    }
    return true;
  }
  return false;
}