flutter:复制粘贴

复制:

 ClipboardData data = new ClipboardData(text:"复制的内容");
 Clipboard.setData(data);

粘贴:

 Clipboard.getData('text');

注意

  • 引用包:import 'package:flutter/services.dart';
  • Clipboard.getData需要传入‘format’:The format argument specifies the media type, such as text/plain, of the data to obtain.

你可能感兴趣的:(flutter:复制粘贴)