copy static method

void copy({
  1. String text = '',
  2. BuildContext? context,
})

Implementation

static void copy({String text = '', BuildContext? context}) {
  Clipboard.setData(ClipboardData(text: text)).then((_) {
    ScaffoldMessenger.of(context!)
        .showSnackBar(const SnackBar(content: Text("Copied to clipboard")));
  });
}