copyToClipBoard static method

Future copyToClipBoard(
  1. String? text
)

Implementation

static Future copyToClipBoard(String? text) async {
  if (text == null) {
    return;
  }
  await Clipboard.setData(
    ClipboardData(text: text),
  );

  Get.showSnackbar(
    GetSnackBar(
      title: "Copied !",
      message: "$text copied to clipboard",
      duration: const Duration(seconds: 2),
    ),
  );
}