WidgetToRenderBoxAdapter constructor

WidgetToRenderBoxAdapter({@required RenderBox renderBox, VoidCallback onBuild })

Creates an adapter for placing a specific RenderBox in the widget tree.

The renderBox argument must not be null.

Implementation

WidgetToRenderBoxAdapter({
  @required this.renderBox,
  this.onBuild,
}) : assert(renderBox != null),
     // WidgetToRenderBoxAdapter objects are keyed to their render box. This
     // prevents the widget being used in the widget hierarchy in two different
     // places, which would cause the RenderBox to get inserted in multiple
     // places in the RenderObject tree.
     super(key: GlobalObjectKey(renderBox));