disposeChildren method

  1. @protected
void disposeChildren()

Disposes and removes all children.

Implementation

@protected
void disposeChildren() {
  // Copy the set to prevent concurrent modification issues during iteration.
  final copy = Set.of(_children);
  for (final child in copy) {
    child.dispose();
    _removeChild(child);
  }
}