copyClipboard function

dynamic copyClipboard(
  1. BuildContext context,
  2. String? value
)

复制到粘贴板

Implementation

copyClipboard(BuildContext context, String? value) {
  var snackBar =
      SnackBar(content: Text('$value\n\n copy success to clipboard'));
  ScaffoldMessenger.of(context).showSnackBar(snackBar);
  Clipboard.setData(ClipboardData(text: value ?? 'null'));
}