adoptChild method

  1. @override
void adoptChild(
  1. RenderBox child
)
override

Called by subclasses when they decide a render object is a child.

Only for use by subclasses when changing their child lists. Calling this in other cases will lead to an inconsistent tree and probably cause crashes.

Implementation

@override
void adoptChild(RenderBox child) {
  super.adoptChild(child);
  final SliverVariableSizeBoxAdaptorParentData childParentData =
      child.parentData as SliverVariableSizeBoxAdaptorParentData;
  if (!childParentData._keptAlive) childManager.didAdoptChild(child);
}