ElementState<T> class

The base component state class used in controlling state in a component or object.

This class contains much more concrete ways of controlling, handling and watching state in a component through the use of streams. These streams watch for state changes and then are updated whenever a state change is received.

This object also encapsulates the state of the component via the State object.

This object makes use of the ComponentStateControl mixin as well as the StateControl mixin to create implementations of functions required for state changes.

Inheritance
Mixed-in types
Implementers

Constructors

ElementState({required T component, State<T>? state})

Properties

component ↔ T
The component
getter/setter pair
componentState State<T>
The current state of the component as a State object.
getter/setter pair
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
stateStream Stream<StateChange<T>>
A Stream of state changes used and updated for watching over changes in state of the element or component.
no setter

Methods

applyState() → void
Function used in making a copy of the current state of an object to be implemented elsewhere in code.
override
change(T newValue, {StateChange<T>? stateChange}) → void
Function used to change state.
override
dispose() → void
Function used in disposing current component state, and disposing of any broadcast streams used in the process.
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