UndoRedoManager class
Undo/Redo system manager using node-level deltas instead of full document snapshots. Memory usage is reduced by 50-100x because only changed top-level nodes are stored.
Constructors
Properties
- canRedo → bool
-
no setter
- canUndo → bool
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastRedoDescription → String?
-
no setter
- lastUndoDescription → String?
-
no setter
- redoCount → int
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- undoCount → int
-
no setter
Methods
-
beginSaveState(
FluentDocument document, {String description = 'Document change', bool forceNewAction = false}) → void - Called BEFORE a mutation. Captures the old state of all top-level nodes so commitSaveState can compute a minimal delta afterwards.
-
clear(
) → void -
commitSaveState(
FluentDocument document) → void - Called AFTER a mutation (from FluentDocument.updateContent). Compares the current top-level nodes with the pending snapshot, builds a minimal DocumentDelta, and pushes it onto the undo stack.
-
dispose(
) → void -
forceNewAction(
FluentDocument document, {String description = 'New action'}) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
redo(
FluentDocument document) → bool -
saveState(
FluentDocument document, {String description = 'Document change', bool forceNewAction = false}) → void - Backward-compatible alias that captures the state and immediately commits it as a delta. Used by tests and handlers that don't go through FluentDocument.updateContent.
-
toString(
) → String -
A string representation of this object.
inherited
-
undo(
FluentDocument document) → bool
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited