visitChildren method Null safety

  1. @override
void visitChildren(
  1. RenderObjectVisitor visitor
)
override

Calls visitor for each immediate child of this render object.

Override in subclasses with children and call the visitor for each child.

Implementation

@override
void visitChildren(RenderObjectVisitor visitor) {
  final RenderObject? foregroundChild = _foregroundRenderObject;
  final RenderObject? backgroundChild = _backgroundRenderObject;
  if (foregroundChild != null) {
    visitor(foregroundChild);
  }
  if (backgroundChild != null) {
    visitor(backgroundChild);
  }
  super.visitChildren(visitor);
}