copyToClipboard method
Copies this string to the clipboard.
If a BuildContext is provided, it will also show a SnackBar
with the given message, or "Copied!" by default.
Implementation
void copyToClipboard([BuildContext? context, String? message]) {
Clipboard.setData(ClipboardData(text: this));
if (context != null) {
ScaffoldMessenger.of(
context,
).showSnackBar(SnackBar(content: Text(message ?? 'Copied!')));
}
}