TrackingContext class
A single frame of the tracking stack, created while an Observer (or similar consumer) runs its builder.
Um quadro da pilha de rastreamento, criado enquanto um Observer (ou consumidor similar) executa seu builder.
Constructors
- TrackingContext(ObserverVoidCallback onDependencyChanged, {String? ownerLabel, bool subscribes = true, void onTrackedWrite(ListenerRegistry registry)?, void onDependencyChangedFrom(ListenerRegistry registry)?})
-
Creates a tracking context that reports dependency changes to
onDependencyChanged.ownerLabel, if given, identifies the Observer/Computed/Effect doing the tracking, forObserverInspector.onTrackevents.
Properties
-
disposers
→ List<
Disposer> -
Disposers accumulated for every distinct observable read while this
context was active. Executed on unmount / next build.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- onDependencyChanged → ObserverVoidCallback
-
Invoked when any observable read during this context later changes.
final
- onDependencyChangedFrom → void Function(ListenerRegistry registry)?
-
Optional dependency-aware variant of onDependencyChanged. Effects use
this to distinguish direct self-invalidations from unrelated
invalidations that happen during the same flush.
final
- onTrackedWrite → void Function(ListenerRegistry registry)?
-
Optional hook invoked when code writes to a CoreObservable while this
context is active. Effects use it to recognize self-invalidations caused
by their own body during a batch flush.
final
- ownerLabel → String?
-
Debug label of the Observer/Computed/Effect that owns this context, if
known. Only used to populate
ObserverInspector.onTrackevents — has no effect on tracking behavior itself.final - readCount ↔ int
-
Number of distinct observables read during this context. Used to warn
about builders that read nothing.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subscribes → bool
-
Whether reads inside this context subscribe onDependencyChanged to
each read registry (the classic Observer/effect behavior). A
recomputing
CoreComputed(engine v2) pushes a non-subscribing context: it still isolates outer contexts, counts reads and emitsonTrackevents, but invalidation is handled by the engine graph, so no registry listeners are registered (and none need disposal).final -
trackedLabels
→ List<
String> -
Debug-only labels of the distinct observables read during this
context, in read order. Used for the Observer tracking log.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited