createRenderer method

  1. @override
RenderObject createRenderer()
inherited

Creates an instance of the RenderObject class that this RenderObjectNode represents, using the configuration described by this RenderObjectNode.

This method should not do anything with the children of the render object. That should instead be handled by the method that overrides Node.attachTo in the object rendered by this object.

Implementation

@override
RenderObject createRenderer() {
  if (renderer != null) {
    return renderer!;
  }

  // Content children layout, BoxModel content.
  if (_isIntrinsicBox) {
    _renderIntrinsic = createRenderIntrinsic(
      this,
      repaintSelf: repaintSelf,
    );
  } else {
    _renderLayoutBox = createRenderLayout(
      this,
      repaintSelf: repaintSelf,
    );
  }

  return renderer!;
}