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