ColorPickerCopyPasteBehavior class

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
Annotations

Constructors

ColorPickerCopyPasteBehavior({bool ctrlC = true, bool ctrlV = true, bool autoFocus = 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 = true})
Default constructor
const

Properties

autoFocus bool
When true, the picker tries to grab the focus when the picker is created.
final
copyButton bool
Show a copy action icon in the picker top tool bar.
final
copyFormat ColorPickerCopyFormat
Defines the format of the copied color code string.
final
copyIcon IconData
Icon used for the copy action.
final
copyTooltip String?
Label used as tooltip for copy action.
final
ctrlC bool
A keyboard CMD/CTRL-C press will copy the clipboard into the picker.
final
ctrlV bool
A keyboard CMD/CTRL-V press will paste the clipboard into the picker.
final
editFieldCopyButton bool
Show a copy button suffix in the color code edit and display field.
final
editUsesParsedPaste bool
If true, the color code entry field uses parsed paste action for keyboard shortcuts CTRL-V and CMD-V,
final
feedbackParseError bool
If true then vibrate, play audible click or an alert sound, when a paste parse error occurs.
final
hashCode int
The hash code for this object.
no setteroverride
longPressMenu bool
Use long press in the picker to open a color copy and paste menu.
final
The theme for the menu icons.
final
The height of each menu item.
final
The theme of the popup menu.
final
The width of the menu.
final
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.
final
pasteButton bool
Show a paste action icon in the picker top tool bar.
final
pasteIcon IconData
Icon used for the paste action icon in the title bar.
final
pasteTooltip String?
Label used as tooltip for paste action.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondaryMenu bool
Use secondary button click in the picker to open a color copy and paste menu.
final
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.
final
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.
final
snackBarDuration Duration
The duration the paste parse error snack bar message is shown.
final
snackBarMessage String?
The message shown in the paste parse error snack bar.
final
snackBarParseError bool
Show a snack bar paste parse error message when pasting something that could not be parsed to a color value.
final

Methods

copyWith({bool? ctrlC, bool? ctrlV, bool? autoFocus, 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.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override