pasteText method

  1. @override
Future<void> pasteText(
  1. SelectionChangedCause cause
)
override

Paste text from Clipboard.

Implementation

@override
Future<void> pasteText(SelectionChangedCause cause) async {
  if (!_allowPaste) {
    return;
  }
  // Snapshot the input before using `await`.
  // See https://github.com/flutter/flutter/issues/11427
  final ClipboardData? data = await Clipboard.getData(Clipboard.kTextPlain);
  if (data == null) {
    return;
  }
  _pasteText(cause, data.text!);
}