layoutPositionedChild static method

void layoutPositionedChild(
  1. RenderBoxModel parent,
  2. RenderBoxModel child, {
  3. bool needsRelayout = false,
})

Implementation

static void layoutPositionedChild(RenderBoxModel parent, RenderBoxModel child, {bool needsRelayout = false}) {
  BoxConstraints childConstraints = child.getConstraints();

  // Whether child need to layout
  bool isChildNeedsLayout = true;
  if (child.hasSize && !needsRelayout && (childConstraints == child.constraints) && (!child.needsLayout)) {
    isChildNeedsLayout = false;
  }

  if (isChildNeedsLayout) {
    if (enableWebFProfileTracking) {
      WebFProfiler.instance.pauseCurrentLayoutOp();
    }

    // Should create relayoutBoundary for positioned child.
    child.layout(childConstraints, parentUsesSize: false);

    if (enableWebFProfileTracking) {
      WebFProfiler.instance.resumeCurrentLayoutOp();
    }
  }
}