removeRenderObjectChild method

  1. @override
void removeRenderObjectChild(
  1. covariant RenderObject child,
  2. covariant _Slot? slot
)
override

Copied from SliverMultiBoxAdaptorElement.removeRenderObjectChild. This method has been changed to prevent the removal of unlisted children (eg off-list elements).

Implementation

@override
void removeRenderObjectChild(
    covariant RenderObject child, final _Slot? slot) {
  if (_creatingDisposableElement) {
    assert(slot == null);
    renderObject.dropChild(child);
    return;
  }
  assert(_creatingDisposableElement || _currentlyUpdatingChildIndex != null);
  final childParentData =
      child.parentData! as MultiSliverMultiBoxAdaptorParentData;
  renderObject.remove(childParentData.key, child as RenderBox);
}