createChild method
void
createChild(})
override
Copied from SliverMultiBoxAdaptorElement.createChild.
Implementation
@override
void createChild(_PopUpList? popUpList, int index,
{required RenderBox? after}) {
assert(_currentlyUpdatingChildIndex == null);
owner!.buildScope(this, () {
final childElements = _childElements.putIfAbsent(
popUpList, () => SplayTreeMap<int, Element?>());
final insertFirst = after == null;
assert(insertFirst || childElements[index - 1] != null);
_currentBeforeChild = insertFirst
? null
: (childElements[index - 1]!.renderObject as RenderBox?);
Element? newChild;
try {
_currentlyUpdatingPopUpList = popUpList;
_currentlyUpdatingChildIndex = index;
newChild = updateChild(childElements[index],
build(index, popUpList: popUpList), _Slot(index, popUpList));
} finally {
_currentlyUpdatingChildIndex = null;
_currentlyUpdatingPopUpList = null;
}
if (newChild != null) {
childElements[index] = newChild;
} else {
childElements.remove(index);
}
});
}