copyable_widget library

Zero-boilerplate clipboard copy for any Flutter widget or text.

Quick start

import 'package:copyable_widget/copyable_widget.dart';

// Copy text with a single line
Copyable.text("TXN-9182736")

// Wrap any widget
Copyable(
  value: accountNumber,
  child: AccountNumberRow(...),
)

// Fully custom copy UI with isCopied state
CopyableBuilder(
  value: walletAddress,
  builder: (context, isCopied) => Icon(
    isCopied ? Icons.check : Icons.copy_rounded,
  ),
)

Classes

Copyable
Wraps any widget with clipboard copy behaviour on tap or long-press.
CopyableBuilder
A fully custom copy widget that exposes an isCopied boolean state.
CopyableEvent
Describes a completed clipboard copy action.
CopyableFeedback
Defines what happens visually after a successful clipboard copy.
CopyableText
A Text widget that copies its content to the clipboard on tap or long-press.
CopyableTheme
An InheritedWidget that provides app-wide defaults for all Copyable and CopyableBuilder widgets in the subtree.
CopyableThemeData
App-wide default configuration for all Copyable and CopyableBuilder widgets.
CustomFeedback
Custom feedback callback. Created via CopyableFeedback.custom.
NoneFeedback
No-op feedback. Created via CopyableFeedback.none.
SnackBarFeedback
Built-in SnackBar feedback. Created via CopyableFeedback.snackBar.

Enums

CopyableActionMode
Controls which gesture triggers the clipboard copy.
HapticFeedbackStyle
Controls the haptic feedback style fired after a successful clipboard copy.