DVStudioEdit class

One editor mutation as data.

Every mutation DVStudioEditorController performs is also published as one of these, and one can be applied to another controller. It is the seam multi-user editing attaches through: a collaborator's controller applies what this one published. The seam is free; what rides on it need not be.

Undo and redo are replace edits carrying the whole document -- the controller's own undo is a snapshot, and inverting an operation log is how collaborative editors get subtly wrong.

Constructors

DVStudioEdit.fromJson(Map<String, Object?> json)
factory
DVStudioEdit.insert(DVPageNode node, {required String parent, int? index})
factory
DVStudioEdit.move(String id, {required String parent, int? index})
factory
DVStudioEdit.remove(String id)
factory
DVStudioEdit.replace(DVPageDocument document)
factory
DVStudioEdit.update(String id, DVPageNode node)
factory

Properties

document → Map<String, Object?>?
The whole document, for replace.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String?
The node acted on: the moved, updated or removed node's id. Null for insert (the node carries its own id) and replace.
final
index → int?
final
kind → String
insert, move, update, remove or replace.
final
node → Map<String, Object?>?
The inserted node, or the updated node's new shape.
final
parent → String?
Where an inserted or moved node goes.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

applyTo(DVPageDocumentEditor editor) → void
Performs this edit on editor. Throws ArgumentError when it cannot -- a node that is not there, a drop into its own subtree -- leaving the document as it was.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited