void removeAllChildren()

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

Source

void removeAllChildren() {
  Layer child = _firstChild;
  while (child != null) {
    Layer next = child.nextSibling;
    child._previousSibling = null;
    child._nextSibling = null;
    child._parent = null;
    child = next;
  }
  _firstChild = null;
  _lastChild = null;
}