Reentrant stack-based dependency tracker.
Replaces a single mutable "current context" with a stack so that nested tracking (e.g. an Observer built inside another Observer) restores the outer context correctly once the inner one finishes.
Rastreador de dependências reentrante, baseado em pilha.
Substitui um único "contexto atual" mutável por uma pilha, de forma que o rastreamento aninhado (ex.: um Observer construído dentro de outro) restaure corretamente o contexto externo quando o interno terminar.
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
-
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
Static Properties
- current → TrackingContext?
-
The innermost active tracking context, or
nullif none is active, or if an untracked call is currently suspending tracking.no setter
Static Methods
-
reportRead(
ListenerRegistry registry, {String? label}) → void -
Called from an observable's
valuegetter to register the current tracking context's own TrackingContext.onDependencyChanged callback (if any context is active) as a listener ofregistry. The context, not the observable, owns the callback that must run whenregistrynotifies — an observable must never register itself as its own listener. -
track<
R> (TrackingContext context, R action()) → R -
Runs
actionwithcontextpushed onto the tracking stack, popping it afterwards even ifactionthrows. -
untracked<
R> (R action()) → R -
Runs
actionwith dependency tracking suspended: any observable read insideactionis not registered as a dependency of whatever Observer/Computed/effect is currently tracking, even though that outer context remains active underneath. Supports nesting (only the outermost call needs to restore suspension). Powers the top-leveluntracked()function andObservable.peek().