FakeTreeContext class

A fake TreeContext for driving an Allocation/Capability bare — no mounted tree. Ambient values resolve from values by EXACT type (mirroring genesis's exact-type inherited lookup). Flip mounted to false to exercise the loud async-gap protection (getInheritedSeedOfExactType then throws, like the real handle).

Constructors

FakeTreeContext({Map<Type, Object> values = const {}})
Creates the fake with the ambient values (keyed by exact type).

Properties

branchId String
Stable id of the bound branch, issued by TreeOwner.issueId at mount.
no setter
hashCode int
The hash code for this object.
no setterinherited
key → Key?
The Key of the bound branch's Seed config, or null if unkeyed.
no setter
mounted bool
Whether the (fake) branch is still mounted — settable so a test drives the unmounted-throw path.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

dependOnInheritedSeedOfExactType<T extends Object>() → T?
Returns the nearest ancestor value provided via InheritedSeed<T> of exact type T, registering the bound branch as a dependent; null when no such ancestor exists.
getInheritedSeedOfExactType<T extends Object>() → T?
Returns the nearest ancestor value provided via InheritedSeed<T> of exact type T without registering a dependency; null when no such ancestor exists.
markNeedsRebuild() → void
Marks the bound branch dirty for the next TreeOwner.flush.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
provide<T extends Object>(T value) → void
Adds/replaces the ambient value for exact type T.
toString() String
A string representation of this object.
inherited

Operators

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