beforeLayout method

void beforeLayout()

Implementation

void beforeLayout() {
  BoxConstraints contentConstraints;
  // @FIXME: Normally constraints is calculated in getConstraints by parent RenderLayoutBox in Kraken,
  // except in sliver layout, constraints is calculated by [RenderSliverList] which kraken can not control,
  // so it needs to invoke getConstraints here for sliver container's direct child.
  if (parent is RenderSliverList) {
    contentConstraints = getConstraints();
  } else {
    // Constraints is already calculated in parent layout.
    contentConstraints = constraints;
  }

  // Deflate border constraints.
  contentConstraints = renderStyle.deflateBorderConstraints(contentConstraints);
  // Deflate padding constraints.
  contentConstraints = renderStyle.deflatePaddingConstraints(contentConstraints);
  _contentConstraints = contentConstraints;
}