parent property

  1. @override
T parent
override

Who owns this component in the component tree.

This can be null if the component hasn't been added to the component tree yet, or if it is the root of component tree.

Setting this property to null is equivalent to removeFromParent.

Implementation

@override
T get parent => super.parent! as T;
void parent=(Component? newParent)
inherited

Implementation

set parent(Component? newParent) {
  if (newParent == null) {
    removeFromParent();
  } else {
    addToParent(newParent);
  }
}