layoutPositionedChild static method
void
layoutPositionedChild(
- RenderBoxModel parent,
- RenderBoxModel child, {
- 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 is RenderBoxModel && !child.needsLayout) ||
(child is RenderTextBox && !child.needsLayout))
) {
isChildNeedsLayout = false;
}
if (isChildNeedsLayout) {
late DateTime childLayoutStartTime;
if (kProfileMode) {
childLayoutStartTime = DateTime.now();
}
// Should create relayoutBoundary for positioned child.
child.layout(childConstraints, parentUsesSize: false);
if (kProfileMode) {
DateTime childLayoutEndTime = DateTime.now();
parent.childLayoutDuration += (childLayoutEndTime.microsecondsSinceEpoch - childLayoutStartTime.microsecondsSinceEpoch);
}
}
}