canPaste method Null safety

bool canPaste(
  1. TextSelectionDelegate delegate
)

Whether the text field managed by the given delegate supports pasting from the clipboard.

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

This does not consider the contents of the clipboard. Subclasses may want to, for example, disallow pasting when the clipboard contains an empty string.

Implementation

bool canPaste(TextSelectionDelegate delegate) {
  return delegate.pasteEnabled;
}