canCopy method

bool canCopy (TextSelectionDelegate delegate)

Whether the current selection of the text field managed by the given delegate can be copied to the Clipboard.

By default, false is returned when nothing is selected in the text field.

Subclasses can use this to decide if they should expose the copy functionality to the user.

Implementation

bool canCopy(TextSelectionDelegate delegate) {
  return !delegate.textEditingValue.selection.isCollapsed;
}