ElementBase<T> class
abstract
Base class of elements. Element holds the actual state. Creator and element always exist as a pair in the graph.
Life cycle of creator/element:
- It is added to the graph when firstly being watched.
- It can be removed from the graph manually by Ref.dispose.
- If it has watchers, it is automatically removed from the graph when losing all its watchers, unless keepAlive property is set.
- Implementers
Constructors
-
ElementBase(Ref ref, CreatorBase<
T> creator, T state)
Properties
- created ↔ bool
-
Whether the creator has been created at least once.
getter/setter pair
-
creator
→ CreatorBase<
T> -
final
- error ↔ Object?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- prevState ↔ T?
-
getter/setter pair
- ref → Ref
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace ↔ StackTrace?
-
getter/setter pair
- state ↔ T
-
getter/setter pair
Methods
-
getState(
) → T - Get error-aware state.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recreate(
{bool autoDispose = false}) → void - Allow the creator to update its state. Called when:
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited