setChild method

  1. @override
void setChild(
  1. RenderObject? newChild
)
override

Set the child render object. Idempotent: passing the current child or one already adopted as this object's child is a no-op.

Implementation

@override
void setChild(RenderObject? newChild) {
  if (newChild != null && newChild is! RenderBox) {
    throw ArgumentError(
      'RenderPositionedBox children must be RenderBox, '
      'got ${newChild.runtimeType}',
    );
  }
  final next = newChild as RenderBox?;
  _child = updateChild(_child, next) as RenderBox?;
}