NodeEditorClipboard class
Copy, cut, paste and duplicate over the selection.
The buffer is in-process, so copy and paste are synchronous and a duplicate
never has to wait on a platform channel. When the controller was given a
NodeGraphCodec, every copy is also written to the system clipboard as
JSON, which is what carries a selection between two editors or across a
restart. Without a codec the package never touches flutter/services.
Constructors
- NodeEditorClipboard(NodeEditorController _controller, {NodeGraphCodec? codec})
Properties
- buffer → GraphFragment?
-
What was last copied, or null if nothing has been.
no setter
- canCopy → bool
-
Whether copy would take anything, so a menu can grey its entry out.
no setter
- canPaste → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- mirrorsToSystem → bool
-
Whether copies also reach the system clipboard.
no setter
- nudge → Offset
-
The offset a paste or a duplicate is placed at, grid or no grid.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void - Empties the buffer. The system clipboard is left alone.
-
copy(
) → bool - Copies the selected nodes and the wires between them.
-
cut(
) → bool - Copies the selection and then deletes what was copied, as a single undo step.
-
duplicate(
{Offset? offset}) → Set< String> - Copies the selection straight back into the document, without disturbing the buffer or the system clipboard.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paste(
{Offset? scenePosition}) → Set< String> - Pastes the buffer and selects the result.
-
pasteFromSystem(
{Offset? scenePosition, bool fallbackToBuffer = true}) → Future< Set< String> > - Pastes whatever the system clipboard holds.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- fragmentKey → const String
- Marks a document on the system clipboard as one of ours.
- originKey → const String
- Where GraphFragment.origin is carried in a document's metadata.
- pasteNudge → const Offset
- How far each successive paste is offset from the last.