CopyButton class

A button that copies data to the clipboard.

Pass a getData callback that returns the string to copy. The button shows "📋 Copy" → "✔ Copied!" (green) or "✘ Failed" (red) for 2 s, then resets. Fully self-contained — no parent state needed.

Constructors

CopyButton({required String getData(), Key? key})
const

Properties

getData → String Function()
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

createElement() → StatefulElement
inherited
createState() → State<CopyButton>
Creates the mutable state for this component.
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