FlutterTargetResolver class

Resolves ElementTarget for local execution.

Snapshot elementId targets always bind to the exact cached Element (identical); they never fall back to testId / first-match.

Targets with ElementTarget.occurrence always resolve to a Finder so the selected match is preserved through execution.

Constructors

FlutterTargetResolver({required WidgetTester tester, required AssertionEngine assertions, required ObservationRegistry registry, String liveFingerprint(Element element, String? testId)?, int currentRevision() = _zeroRevision})

Properties

assertions → AssertionEngine
final
currentRevision → int Function()
The observable UI revision. Cached finders are valid only at this revision and are discarded as soon as the observer advances it.
final
hashCode → int
The hash code for this object.
no setterinherited
liveFingerprint → String Function(Element element, String? testId)?
When set, snapshot targets are revalidated against live observable state.
final
registry → ObservationRegistry
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tester → WidgetTester
final

Methods

invalidateResolvedFinders() → void
Discard handles at an operation boundary, even if the observer's lightweight fingerprint did not detect a UI change.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requireTestId(ElementTarget target) → String
TestId for direct step-executor dispatch only.
resolve(ElementTarget target, {bool requireInteractive = true}) → ResolvedTarget
resolveFinder(ElementTarget target, {bool requireInteractive = true, bool allowEmpty = false, bool allowOffscreen = false}) → Finder
Returns a Finder for the target. Snapshot targets never fall back to testId.
resolveMatches(ElementTarget target, {bool requireInteractive = true, bool allowEmpty = false, bool allowOffscreen = false}) → List<Element>
Candidate elements for target, after semantic/text collapse and optional interactive filtering. Throws on ambiguity for positive resolution; returns [] when allowEmpty and nothing matches.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited