ClipboardHelper class abstract final

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 text to the clipboard silently.
copyWithFeedback(BuildContext context, String text, {String? message}) Future<void>
Writes text to the clipboard and shows a SnackBar in context.
hasContent() Future<bool>
Returns true if the clipboard currently contains plain-text content.
paste() Future<String?>
Returns the current clipboard text, or null if the clipboard is empty or contains non-text data.