attach method

  1. @override
void attach(
  1. PipelineOwner owner
)
override

Mark this render object 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(PipelineOwner owner) {
  super.attach(owner);
  switch (state) {
    case RenderAnimatedSizeState.start:
    case RenderAnimatedSizeState.stable:
      break;
    case RenderAnimatedSizeState.changed:
    case RenderAnimatedSizeState.unstable:
      // Call markNeedsLayout in case the RenderObject isn't marked dirty
      // already, to resume interrupted resizing animation.
      markNeedsLayout();
  }
  _controller.addStatusListener(_animationStatusListener);
}