copy static method

void copy(
  1. BuildContext context,
  2. String? text, {
  3. String? toastText,
})

Implementation

static void copy(BuildContext context, String? text, {String? toastText}) {
  Clipboard.setData(ClipboardData(text: text ?? ""));
  HapticFeedback.lightImpact();
  if (toastText != null) {
    showToast(context, message: toastText);
  }
}