copy static method

void copy(
  1. BuildContext context, {
  2. required String content,
  3. required Color? bgColor,
  4. required String text,
})

copy Copy text to clipboard and show toast

  • Param content Text to copy
  • Param bgColor Background color of showToast

Implementation

static void copy(BuildContext context,
    {required String content,
    required Color? bgColor,
    required String text}) {
  Clipboard.setData(new ClipboardData(text: content)).then((_) {
    showToast(text, bgColor: bgColor);
  });
}