removeChild method

  1. @override
void removeChild(
  1. _PopUpList? popUpList,
  2. RenderBox child
)
override

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));
  });
}