ClipboardService class

App-facing clipboard facade.

final clipboard = ClipboardService();
await clipboard.copy('tok-1');
final token = await clipboard.paste();   // 'tok-1'
await clipboard.copySensitive('tok-1');  // same as copy, semantic marker
await clipboard.clear();

Constructors

ClipboardService({ClipboardPort? port})

Properties

hashCode → int
The hash code for this object.
no setterinherited
hasText → Future<bool>
Whether the clipboard holds any text.
no setter
port → ClipboardPort
The platform adapter (or the in-memory default in tests).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() → Future<void>
Clears the clipboard.
copy(String text) → Future<void>
Copies text to the clipboard.
copySensitive(String text) → Future<void>
Copies text flagged as sensitive — same storage behavior as copy; the marker documents intent for adapters that can, e.g., expire the entry early.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paste() → Future<String?>
Reads the clipboard, or null when empty.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited