Ref class
Ref holds the creator graph data, including states and dependencies.
Constructors
- Ref({CreatorObserver? observer})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
CreatorBase creator) → void - Try delete the creator from the graph. No-op for creators with watchers. It can delete creator even if it has keepAlive set.
-
disposeAll(
) → void - Delete all creators. Ref will become empty after this call.
-
elementsString(
) → String -
emit<
T> (Emitter< T> emitter, T state) → void - Set state of the emitter. Use this only if you control all the paths the emitter could be recreated, to avoid the value emitted here override by other state propagation flows.
-
graphDebugString(
) → String -
graphString(
) → String -
keepDependency(
) → void - Tell the framework that the current recreation didn't change the dependency, so that dependency check is skipped for once. This is rarely needed, but could be useful if the recreation makes conditional side effects outside of the graph.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onClean(
void onClean()) → void - Provide a callback which the framework will call before next create call and when the creator is disposed.
-
read<
T> (CreatorBase< T> creator) → T - Read the current state of the creator.
-
readSelf<
T> () → T? - Read the current state of the ref owner. This allows creators to have memories. Note that the creator needs defined in a stable variable or use args if using this method. See CreatorBase.args.
-
recreate<
T> (CreatorBase< T> creator) → void - Recreate the state of a creator. It is typically used when things outside the graph changes. For example, click to retry after a network error. If you use this method in a creative way, let us know.
-
set<
T> (Creator< T> creator, T state) → void - Set state of the creator. Typically this is used to set the state for creator with no dependency, but the framework allows setting state for any creator. No-op if the state doesn't change.
-
toString(
) → String -
A string representation of this object.
inherited
-
update<
T> (Creator< T> creator, T update(T)) → void - Set state of creator using an update function. See set. No-op if the state doesn't change.
-
watch<
T> (CreatorBase< T> creator) → T -
Read the current state of the creator, also establish the dependency
creator
->_owner
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited