abstract class RenderObjectElement extends Element { /// Creates an element that uses the given widget as its configuration. RenderObjectElement(RenderObjectWidget super.widget); ··· RenderObject? _renderObject;
@override void mount(Element? parent, Object? newSlot) { super.mount(parent, newSlot); ··· _renderObject = (widget as RenderObjectWidget).createRenderObject(this); ··· super.performRebuild(); // clears the "dirty" flag }
@override void performLayout() { super.performLayout(); // xOffsets will contain childCount+1 values, giving the offsets of the // leading edge of the first tab as the first value, of the leading edge of // the each subsequent tab as each subsequent value, and of the trailing // edge of the last tab as the last value. RenderBox? child = firstChild; final List<double> xOffsets = <double>[]; while (child != null) { final FlexParentData childParentData = child.parentData! as FlexParentData; xOffsets.add(childParentData.offset.dx); assert(child.parentData == childParentData); //nextSibling: The next sibling in the parent's child list. child = childParentData.nextSibling; } assert(textDirection != null); switch (textDirection!) { case TextDirection.rtl: xOffsets.insert(0, size.width); break; case TextDirection.ltr: xOffsets.add(size.width); break; } onPerformLayout(xOffsets, textDirection!, size.width); } }