ConstraintChainLink class

Analyzes the constraint chain from a render object up to the root.

When a layout overflow occurs, answering "why?" requires tracing the constraint chain: which ancestor imposed the tight constraint?

This class walks the render tree upward and captures each ancestor's constraints, so the developer can see the entire constraint pipeline.

Usage

final chain = ConstraintChainAnalyzer.analyze(myRenderBox);
for (final link in chain) {
  print('${link.widgetType}: ${link.constraints}');
}

Constructors

ConstraintChainLink({required String widgetType, required Constraints constraints, Size? size, required int depth})
const

Properties

constraints Constraints
The constraints this render object received from its parent.
final
depth int
Depth in the tree (0 = target, increasing = toward root).
final
hashCode int
The hash code for this object.
no setterinherited
isTight bool
Whether this link has tight constraints (no flexibility).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size Size?
The size this render object reported (if it's a RenderBox).
final
widgetType String
The render object type name.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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