paste method

Future<void> paste()

Inserts clipboard content at the cursor, replacing any selection.

Implementation

Future<void> paste() async {
  final clipboardText = await Clipboard.getData();
  if (clipboardText != null && clipboardText.isNotEmpty) {
    if (hasSelection) {
      deleteSelection();
    }
    insertText(clipboardText);
  }
}