updateSlotForChild method Null safety

  1. @protected
void updateSlotForChild(
  1. Element child,
  2. Object? newSlot
)
protected">@protected

Change the slot that the given child occupies in its parent.

Called by MultiChildRenderObjectElement, and other RenderObjectElement subclasses that have multiple children, when child moves from one position to another in this element's child list.

Implementation

@protected
void updateSlotForChild(Element child, Object? newSlot) {
  assert(_lifecycleState == _ElementLifecycle.active);
  assert(child != null);
  assert(child._parent == this);
  void visit(Element element) {
    element._updateSlot(newSlot);
    if (element is! RenderObjectElement) {
      element.visitChildren(visit);
    }
  }
  visit(child);
}