DependencyTracker class abstract final

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 null if 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 value getter to register the current tracking context's own TrackingContext.onDependencyChanged callback (if any context is active) as a listener of registry. The context, not the observable, owns the callback that must run when registry notifies — an observable must never register itself as its own listener.
track<R>(TrackingContext context, R action()) → R
Runs action with context pushed onto the tracking stack, popping it afterwards even if action throws.
untracked<R>(R action()) → R
Runs action with dependency tracking suspended: any observable read inside action is 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-level untracked() function and Observable.peek().