insertRenderObjectChild method
Copied from SliverMultiBoxAdaptorElement.insertRenderObjectChild. This method has been changed to prevent inserting off-list elements into the children list.
Implementation
@override
void insertRenderObjectChild(
covariant RenderObject child, final _Slot? slot) {
//""""""""""""""""""""""""""""""""""""""""""""""""""""""
if (_creatingDisposableElement) {
assert(slot == null);
renderObject.setupParentData(child);
renderObject.adoptChild(child);
return;
}
//""""""""""""""""""""""""""""""""""""""""""""""""""""""
assert(_currentlyUpdatingChildIndex == slot!.index);
// assert(renderObject.debugValidateChild(child)); // l'ho asteriscato in MultiContainerRenderObjectMixin!!!!!!!!!!!!
// final x = debugRenderBox(child);
renderObject.insert(_currentlyUpdatingPopUpList, child as RenderBox,
after: _currentBeforeChild);
assert(() {
final childParentData =
child.parentData! as MultiSliverMultiBoxAdaptorParentData;
assert(slot!.index == childParentData.index);
return true;
}());
}