copy method
void
copy()
Copies the currently selected text to the clipboard.
If no text is selected, does nothing.
Implementation
void copy() {
final sel = selection;
if (sel.start == sel.end) return;
final selectedText = text.substring(sel.start, sel.end);
Clipboard.setData(ClipboardData(text: selectedText));
}