getClipboardData static method

Future<String> getClipboardData()

从剪贴板获取文本内容

Implementation

static Future<String> getClipboardData() async {
  ClipboardData? data = await Clipboard.getData(Clipboard.kTextPlain);
  return data?.text ?? '';
}