History<S> class

Constructors

History(S present, {int limit = 100})
Create a new history with an initial present state.

Properties

canRedo bool
Whether a redo is possible.
no setter
canUndo bool
Whether an undo is possible.
no setter
futureLength int
Number of items in the future stack.
no setter
hashCode int
The hash code for this object.
no setterinherited
limit int
Maximum number of entries retained in the past stack. (Present is always retained; future is unbounded except by usage.)
final
pastLength int
Number of items in the past stack.
no setter
present → S
The current value.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clear() History<S>
Clear the history stacks while keeping the current present.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
redo() History<S>
Redo to the next state, if available.
reduce(S op(S), {String? label}) History<S>
Apply op to the current present, pushing the old present to past, clearing future. label is accepted for UI logging but not stored.
toString() String
A string representation of this object.
inherited
undo() History<S>
Undo to the previous state, if available.
withPresent(S next, {String? label}) History<S>
Replace the present with next (equivalent to reduce((_) => next)).

Operators

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