removeAllChildren method

void removeAllChildren()

Removes all of this layer's children from its child list.

Implementation

void removeAllChildren() {
  assert(!_debugMutationsLocked);
  Layer? child = firstChild;
  while (child != null) {
    final Layer? next = child.nextSibling;
    child._previousSibling = null;
    child._nextSibling = null;
    assert(child.attached == attached);
    _dropChild(child);
    child._parentHandle.layer = null;
    child = next;
  }
  _firstChild = null;
  _lastChild = null;
}