getDepthFor method

int getDepthFor(
  1. ConstrainedNode constrainedNode,
  2. bool? parentSizeConfirmed,
  3. double? resolvedWidth,
  4. double? resolvedHeight,
)

Implementation

int getDepthFor(ConstrainedNode constrainedNode, bool? parentSizeConfirmed,
    double? resolvedWidth, double? resolvedHeight) {
  if (parentSizeConfirmed == false) {
    if (constrainedNode.isParent()) {
      /// The width and height can be calculated directly without relying on parent
      if ((width >= 0 ||
              width == wrapContent ||
              (width == matchParent && resolvedWidth != wrapContent)) &&
          (height >= 0 ||
              height == wrapContent ||
              (height == matchParent && resolvedHeight != wrapContent))) {
        return 0;
      }
    }
  }
  return constrainedNode.getDepth(
      parentSizeConfirmed, resolvedWidth, resolvedHeight);
}