attachRootWidget method
- Widget rootWidget
Takes a widget and attaches it to the rootElement, creating it if necessary.
This is called by runApp to configure the widget tree.
See also:
- RenderObjectToWidgetAdapter.attachToRenderTree, which inflates a widget and attaches it to the render tree.
Implementation
void attachRootWidget(Widget rootWidget) {
final bool isBootstrapFrame = rootElement == null;
_readyToProduceFrames = true;
_rootElement = RenderObjectToWidgetAdapter<RenderBox>(
container: renderView,
debugShortDescription: '[root]',
child: rootWidget,
).attachToRenderTree(buildOwner!, rootElement as RenderObjectToWidgetElement<RenderBox>?);
if (isBootstrapFrame) {
SchedulerBinding.instance.ensureVisualUpdate();
}
}