CarpenterUndoController class final
Caller-ownable undo/redo history for application commands.
Registering a new operation clears redo history. Failed undo or redo work leaves both stacks untouched so the caller can retry after recovering from a transient failure.
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
CarpenterUndoState> - CarpenterUndoController
Constructors
- CarpenterUndoController({int maximumDepth = 100})
-
Creates empty history with the bounded
maximumDepth.
Properties
- canRedo → bool
-
Whether a redo can start now.
no setter
- canUndo → bool
-
Whether an undo can start now.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- maximumDepth → int
-
Maximum number of completed operations retained for undo.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ CarpenterUndoState
-
The current value stored in this notifier.
getter/setter pairinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clear(
) → void - Clears both history stacks and the last error.
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
redo(
) → Future< bool> - Executes the next redo operation and returns whether one ran.
-
register(
CarpenterUndoableOperation operation) → void -
Registers a completed reversible
operationand clears redo history. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
undo(
) → Future< bool> - Executes the next undo operation and returns whether one ran.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited