Link class final
Represents a dependency relationship between two reactive nodes.
A Link connects a dependency (dep) to a subscriber (sub), forming an edge in the reactive dependency graph. Each link is part of two doubly-linked lists:
- The dependency list of the subscriber node
- The subscriber list of the dependency node
This dual-list structure allows for efficient traversal and modification of the dependency graph from both directions.
The version tracking ensures that stale dependencies are properly updated or removed during reactive computations.
Constructors
- Link({required int version, required ReactiveNode dep, required ReactiveNode sub, Link? prevSub, Link? nextSub, Link? prevDep, Link? nextDep})
Properties
- dep ↔ ReactiveNode
-
The dependency node (the node being depended upon).
This is the source of data that the subscriber reads from.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- nextDep ↔ Link?
-
Next link in the dependency list of the subscriber node.
Used for traversing all dependencies of a subscriber.
getter/setter pair
- nextSub ↔ Link?
-
Next link in the subscriber list of the dependency node.
Used for traversing all subscribers of a dependency.
getter/setter pair
- prevDep ↔ Link?
-
Previous link in the dependency list of the subscriber node.
Used for traversing all dependencies of a subscriber.
getter/setter pair
- prevSub ↔ Link?
-
Previous link in the subscriber list of the dependency node.
Used for traversing all subscribers of a dependency.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sub ↔ ReactiveNode
-
The subscriber node (the node that depends on dep).
This node will be notified when dep changes.
getter/setter pair
- version ↔ int
-
Version number for tracking staleness of this dependency relationship.
Used to determine if the link is still valid or needs updating.
getter/setter pair
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