void append(Layer child)

Adds the given layer to the end of this layer's child list

Source

void append(Layer child) {
  assert(child != this);
  assert(child != _firstChild);
  assert(child != _lastChild);
  assert(child._parent == null);
  assert(child._nextSibling == null);
  assert(child._previousSibling == null);
  assert(() {
    Layer node = this;
    while (node.parent != null)
      node = node.parent;
    assert(node != child); // indicates we are about to create a cycle
    return true;
  });
  child._parent = this;
  child._previousSibling = _lastChild;
  if (_lastChild != null)
    _lastChild._nextSibling = child;
  _lastChild = child;
  if (_firstChild == null)
    _firstChild = child;
}