attach method

  1. @override
void attach(
  1. covariant Object owner
)
override

Mark this layer as attached to the given owner.

Typically called only from the parent's attach method, and by the owner to mark the root of a tree as attached.

Subclasses with children should override this method to attach all their children to the same owner after calling the inherited method, as in super.attach(owner).

Implementation

@override
void attach(Object owner) {
  assert(!_debugMutationsLocked);
  super.attach(owner);
  Layer? child = firstChild;
  while (child != null) {
    child.attach(owner);
    child = child.nextSibling;
  }
}