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>
Clears the history stacks while retaining 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)) History<S>
Applies op to the current present, pushes the previous value to the past stack, and clears the future stack.
toString() String
A string representation of this object.
inherited
undo() History<S>
Undo to the previous state, if available.
withPresent(S next) History<S>
Replaces the current present with next.

Operators

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