TCopyButton constructor

const TCopyButton({
  1. Key? key,
  2. required String text,
  3. String? label,
  4. String? copiedLabel,
  5. dynamic icon,
  6. dynamic copiedIcon,
  7. TButtonType type = TButtonType.softText,
  8. TButtonSize size = TButtonSize.xs,
  9. Color? color,
  10. Color? copiedColor,
  11. String? tooltip = 'Copy to clipboard',
  12. String? copiedTooltip = 'Copied!',
  13. bool showToast = false,
  14. String toastMessage = 'Copied to clipboard',
  15. Duration resetDuration = const Duration(seconds: 2),
  16. VoidCallback? onCopied,
})

Creates a copy button.

Implementation

const TCopyButton({
  super.key,
  required this.text,
  this.label,
  this.copiedLabel,
  this.icon,
  this.copiedIcon,
  this.type = TButtonType.softText,
  this.size = TButtonSize.xs,
  this.color,
  this.copiedColor,
  this.tooltip = 'Copy to clipboard',
  this.copiedTooltip = 'Copied!',
  this.showToast = false,
  this.toastMessage = 'Copied to clipboard',
  this.resetDuration = const Duration(seconds: 2),
  this.onCopied,
});