ReWritableHistorizedValuable<T> class abstract

Contract class for StatefulValuable that provide rewritable history management

Like HistorizedValuable, this class provide an history accessor but provide extra methods to navigate through values history too.

canUndo and canRedo allow to know if backward or forward navigation in history are possible.

undo and redo apply the navigation.

Logically, undo can't go beyond the first value ever. The history must retains its first node forever (the initial value of the Valuable)

Likewise, redo can't go beyond the last node in history.

Unlike HistorizedValuable, history is setted from the setValue so that every value can be retrieve from history.

Implemented types
Available Extensions

Constructors

ReWritableHistorizedValuable(StatefulValuable<T> valuable)
factory

Properties

canRedo bool
Tests if redo or redoToCurrent may be applied
no setter
canUndo bool
Tests if undo or undoToInitial may be applied
no setter
currentHistoryHead int
Current index position for the history pointer
no setter
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
history UnmodifiableQueueView<ValuableHistoryNode<T>>
History of this Valuable
no setterinherited
isMounted bool
Returns if this object is still mounted
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state → T
no setterinherited
valuableContext ValuableContext?
no setterinherited
valueCache → _ValueCache
finalinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
cleanWatched() → void
inherited
dispose() → void
Should be called to clean all links to other Valuables, and all the rest
inherited
equals(dynamic other) Valuable<bool>
Compare with a value that type is Output or another Valuable
inherited
getValue([ValuableContext? context = const ValuableContext()]) → T
Get the current value of the Valuable
inherited
getValueDefinition(bool reevaluatingNeeded, [ValuableContext? context = const ValuableContext()]) → T
This method should be redefined in ever sub-classes to determine how works the method getValue
inherited
historize() HistorizedStatefulValuable<T>
Build an HistorizedStatefulValuable based on this Valuable
inherited
historizeRW() ReWritableHistorizedValuable<T>
Build an ReWritableHistorizedValuable based on this Valuable
inherited
listenDispose(VoidCallback onDispose) → void
Allows to be notified when this Valuable is disposed
inherited
map<Other>(Other toElement(T)) Valuable<Other>
A method to map a Valuable from Output to Other
inherited
markToReevaluate() → void
Mark the valuable to be reevaluated
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notEquals(dynamic other) Valuable<bool>
Compare with a value that type is Output or another Valuable
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onValuableChange() → void
Called when a Valuable notify a change.
inherited
redo() → void
Go forward in history
redoToCurrent() → void
Go forward in history, to the current value
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
setValue(T value) → void
inherited
toString() String
A string representation of this object.
inherited
undo() → void
Go backward in history
undoToInitial() → void
Go backward in history, to the initial value
unwatch(Valuable valuable) → void
Remove listener on the valuable, that may change scope, or that about to be disposed Internal purpose
inherited
watch<T>(Valuable<T> valuable, {ValuableContext? valuableContext, ValuableWatcherSelector<T>? selector}) → T
Watch a valuable, that eventually change
inherited

Operators

operator <(dynamic other) Valuable<bool>
Compare with a value that type is Output or another Valuable
inherited
operator <=(dynamic other) Valuable<bool>
Compare with a value that type is Output or another Valuable
inherited
operator ==(Object other) bool
The equality operator.
inherited
operator >(dynamic other) Valuable<bool>
Compare with a value that type is Output or another Valuable
inherited
operator >=(dynamic other) Valuable<bool>
Compare with a value that type is Output or another Valuable
inherited