ColorPickerCopyPasteBehavior class Null safety

Used by FlexColorPicker to define how copy-paste operations behave.

  • Copy and paste action buttons in the top toolbar.
  • Long press and/or right click copy and paste context menu.
  • Ctrl-C and Ctrl-V keyboard shortcuts, also when not in edit field. Keyboard shortcuts automatically uses Command instead of Ctrl on macOS.
  • A copy color action button in the code entry and display field.

You can also:

  • Define default result RGB string format of a copy command.
  • Define icons for copy and paste action buttons.
  • Define icon theme's for the copy and paste icons.
  • Define paste color string parsing error feedback type and message if used.
  • Modify the tooltips for copy and paste buttons.

Paste operation supports all RGB string formats defined by ColorPickerCopyFormat, but copy format is only in selected copyFormat.

Mixed in types


ColorPickerCopyPasteBehavior({bool ctrlC = true, bool ctrlV = true, bool copyButton = false, bool pasteButton = false, IconData copyIcon = Icons.copy, IconData pasteIcon = Icons.paste, String? copyTooltip, String? pasteTooltip, ColorPickerCopyFormat copyFormat = ColorPickerCopyFormat.dartCode, bool longPressMenu = false, bool secondaryMenu = false, bool secondaryOnDesktopLongOnDevice = false, bool secondaryOnDesktopLongOnDeviceAndWeb = false, bool editFieldCopyButton = true, IconThemeData? menuIconThemeData, PopupMenuThemeData? menuThemeData, double menuWidth = 80, double menuItemHeight = 30, bool snackBarParseError = false, String? snackBarMessage, Duration snackBarDuration = const Duration(milliseconds: 1800), bool feedbackParseError = false, bool parseShortHexCode = false, bool editUsesParsedPaste = false})
Default constructor


copyButton bool
Show a copy action icon in the picker top tool bar. [...]
copyFormat ColorPickerCopyFormat
Defines the format of the copied color code string. [...]
copyIcon IconData
Icon used for the copy action. [...]
copyTooltip String?
Label used as tooltip for copy action. [...]
ctrlC bool
A keyboard CMD/CTRL-C press will copy the clipboard into the picker. [...]
ctrlV bool
A keyboard CMD/CTRL-V press will paste the clipboard into the picker. [...]
editFieldCopyButton bool
Show a copy button suffix in the color code edit and display field. [...]
editUsesParsedPaste bool
If true, the color code entry field uses parsed paste action for keyboard shortcuts CTRL-V and CMD-V, [...]
feedbackParseError bool
If true then vibrate, play audible click or an alert sound, when a paste parse error occurs. [...]
hashCode int
The hash code for this object. [...]
read-only, override
longPressMenu bool
Use long press in the picker to open a color copy and paste menu. [...]
The theme for the menu icons. [...]
The height of each menu item. [...]
The theme of the popup menu. [...]
The width of the menu. [...]
parseShortHexCode bool
When true the hex color code paste action and field entry parser, interpret short three character web hex color codes like in CSS. [...]
pasteButton bool
Show a paste action icon in the picker top tool bar. [...]
pasteIcon IconData
Icon used for the paste action icon in the title bar. [...]
pasteTooltip String?
Label used as tooltip for paste action. [...]
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
secondaryMenu bool
Use secondary button click in the picker to open a color copy and paste menu. [...]
secondaryOnDesktopLongOnDevice bool
Use secondary button click on desktop and their web version and long press on iOs/Android devices in the picker, to open a color copy and paste context menu. [...]
secondaryOnDesktopLongOnDeviceAndWeb bool
Use secondary button click on desktop and long press on iOs/Android devices and all web builds in the picker, to open a color copy and paste context menu. [...]
snackBarDuration Duration
The duration the paste parse error snack bar message is shown. [...]
snackBarMessage String?
The message shown in the paste parse error snack bar. [...]
snackBarParseError bool
Show a snack bar paste parse error message when pasting something that could not be parsed to a color value. [...]


copyWith({bool? ctrlC, bool? ctrlV, bool? copyButton, bool? pasteButton, IconData? copyIcon, IconData? pasteIcon, String? copyTooltip, String? pasteTooltip, ColorPickerCopyFormat? copyFormat, bool? longPressMenu, bool? secondaryMenu, bool? secondaryOnDesktopLongOnDevice, bool? secondaryOnDesktopLongOnDeviceAndWeb, bool? editFieldCopyButton, IconThemeData? menuIconThemeData, PopupMenuThemeData? menuThemeData, double? menuWidth, double? menuItemHeight, bool? snackBarParseError, String? snackBarMessage, Duration? snackBarDuration, bool? feedbackParseError, bool? parseShortHexCode, bool? editUsesParsedPaste}) ColorPickerCopyPasteBehavior
Copy the object with one or more provided properties changed.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep. [...]
toString({DiagnosticLevel minLevel =}) String
A string representation of this object. [...]
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode. [...]


operator ==(Object other) bool
The equality operator. [...]