copyToClipBoard function
- String text
Implementation
Future<void> copyToClipBoard(String text) async {
try {
await Clipboard.setData(ClipboardData(text: text));
CustomFlashWidget.showFlashMessage(
type: FlashType.success,
title: "Copied",
message: "Copied to clipboard",
);
} catch (e) {
CustomFlashWidget.showFlashMessage(
type: FlashType.error,
title: "Error",
message: "Failed to copy to clipboard",
);
}
}