didLayout method

void didLayout()

Implementation

void didLayout() {
  scrollableViewportSize = Size(
    _contentSize!.width +
      renderStyle.paddingLeft.computedValue +
      renderStyle.paddingRight.computedValue,
    _contentSize!.height +
      renderStyle.paddingTop.computedValue +
      renderStyle.paddingBottom.computedValue);

  setUpOverflowScroller(scrollableSize, scrollableViewportSize);

  if (positionedHolder != null &&
      renderStyle.position != CSSPositionType.sticky) {
    // Make position holder preferred size equal to current element boundary size except sticky element.
    positionedHolder!.preferredSize = Size.copy(size);
  }

  // Positioned renderBoxModel will not trigger parent to relayout. Needs to update it's offset for itself.
  if (parentData is RenderLayoutParentData) {
    RenderLayoutParentData selfParentData =
        parentData as RenderLayoutParentData;
    RenderBoxModel? parentBox = parent as RenderBoxModel?;
    if (selfParentData.isPositioned && parentBox!.hasSize) {
      CSSPositionedLayout.applyPositionedChildOffset(parentBox, this);
    }
  }

  needsLayout = false;
}