StateObject<T> class
This is the class that makes use of the State class, with proper definitions of overriden functions from State.
This class is used directly in other component state classes in instantiating state on a value, or variable defined with type T
.
The state of such variable is recorded by instantiating its initValue, and then updating the currentValue via changes recorded by change.
Concrete implementations of freeze, unfreeze and reload are given here.
Constructors
- StateObject({required T initValue, T? newValue})
Properties
- currentValue → T
-
The current value of the variable
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- initValue → T
-
The initial value of the variable.
finalinherited
- previousValue → T
-
The previous value of the variable
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
change(
T newValue, {StateChange< T> ? stateChange}) → void -
Function used to change state.
override
-
freeze(
) → void -
Function used to freeze state.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reload(
) → void -
Function used to refresh or reload state.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
unfreeze(
) → void -
Function used to unfreeze state.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited