Static helpers for reading and writing the system clipboard.
// Copy with a SnackBar confirmation
await ClipboardHelper.copyWithFeedback(context, 'https://example.com');
// Silent copy
await ClipboardHelper.copy('secret-token');
// Paste
final text = await ClipboardHelper.paste();
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
copy(
String text) → Future< void> -
Writes
textto the clipboard silently. -
copyWithFeedback(
BuildContext context, String text, {String? message}) → Future< void> -
Writes
textto the clipboard and shows a SnackBar incontext. -
hasContent(
) → Future< bool> -
Returns
trueif the clipboard currently contains plain-text content. -
paste(
) → Future< String?> -
Returns the current clipboard text, or
nullif the clipboard is empty or contains non-text data.