findTightCulprit static method

ConstraintChainLink? findTightCulprit(
  1. List<ConstraintChainLink> chain
)

Find the first ancestor in the chain that imposes tight constraints.

This is typically the "culprit" that causes overflow — it doesn't give enough space to its descendants.

Implementation

static ConstraintChainLink? findTightCulprit(
  List<ConstraintChainLink> chain,
) {
  // Skip the target itself (index 0), look at parents
  for (int i = 1; i < chain.length; i++) {
    if (chain[i].isTight) return chain[i];
  }
  return null;
}