UndoRedoStack class

Bounded LIFO of patch frames.

Constructors

UndoRedoStack({int maxDepth = 200})

Properties

canRedo bool
no setter
canUndo bool
no setter
changes Stream<UndoState>
no setter
hashCode int
The hash code for this object.
no setterinherited
maxDepth int
final
redoDepth int
no setter
redoFrames List<UndoFrame>
Snapshot of the redo half (oldest first, top-of-stack last).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackDepth int
no setter
undoFrames List<UndoFrame>
Snapshot of the undo half (oldest first, top-of-stack last). Used by UndoLog to persist the stack for crash recovery.
no setter

Methods

clear() → void
dispose() Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
popRedo() → _UndoRedoEntry?
Pop the top redo frame; returns its forward patch so the caller can re-apply it.
popUndo() → _UndoRedoEntry?
Pop the top forward frame; returns its inverse so the caller (the pipeline) can apply it to the canonical. Returns null when empty.
push({required JsonPatchSet forward, required JsonPatchSet inverse, Object? originator}) → void
Record a successful patch. Clears the redo stack — pushing a new branch invalidates the previous redo line.
seedFrames({List<UndoFrame> undoFrames = const [], List<UndoFrame> redoFrames = const []}) → void
Replace the current undo / redo halves with the supplied frames — used by host code rehydrating from an UndoLog snapshot. The argument lists follow the same order as undoFrames / redoFrames (top-of-stack last).
toString() String
A string representation of this object.
inherited

Operators

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