adoptChild method Null safety

  1. @override
void adoptChild(
  1. covariant Layer child
)
override

Mark the given node as being a child of this node.

Subclasses should call this function when they acquire a new child.

Implementation

@override
void adoptChild(Layer child) {
  assert(!_debugMutationsLocked);
  if (!alwaysNeedsAddToScene) {
    markNeedsAddToScene();
  }
  if (child._compositionCallbackCount != 0) {
    _updateSubtreeCompositionObserverCount(child._compositionCallbackCount);
  }
  super.adoptChild(child);
}