removeChild method
Copied from SliverMultiBoxAdaptorElement.removeChild.
Implementation
@override
void removeChild(_PopUpList? popUpList, RenderBox child) {
final index = renderObject.indexOf(child);
final popUpList =
(child.parentData! as MultiSliverMultiBoxAdaptorParentData).key;
assert(_currentlyUpdatingPopUpList == null);
assert(_currentlyUpdatingChildIndex == null);
assert(index >= 0);
owner!.buildScope(this, () {
final childElements = _childElements[popUpList]!;
assert(childElements.containsKey(index));
try {
_currentlyUpdatingPopUpList = popUpList;
_currentlyUpdatingChildIndex = index;
final result =
updateChild(childElements[index], null, _Slot(index, popUpList));
assert(result == null);
} finally {
_currentlyUpdatingChildIndex = null;
_currentlyUpdatingPopUpList = null;
}
childElements.remove(index);
assert(!childElements.containsKey(index));
});
}