Example #1
0
 public void attachRootWidget(Widget rootWidget)
 {
     _renderViewElement = new RenderObjectToWidgetAdapter <RenderBox>(
         container: renderView,
         debugShortDescription: "[root]",
         child: rootWidget
         ).attachToRenderTree(buildOwner, _renderViewElement);
 }
Example #2
0
        public void detachRootWidget()
        {
            if (this._renderViewElement == null)
            {
                return;
            }

            this.attachRootWidget(null);
            this.buildOwner.buildScope(this._renderViewElement);
            this.buildOwner.finalizeTree();

            this.pipelineOwner.rootNode = null;
            this._renderViewElement.deactivate();
            this._renderViewElement.unmount();
            this._renderViewElement = null;
        }
Example #3
0
        public void detachRootWidget()
        {
            if (_renderViewElement == null)
            {
                return;
            }

            //The former widget tree must be layout first before its destruction
            drawFrame();
            attachRootWidget(null);
            buildOwner.buildScope(_renderViewElement);
            buildOwner.finalizeTree();

            pipelineOwner.rootNode = null;
            _renderViewElement.deactivate();
            _renderViewElement.unmount();
            _renderViewElement = null;
        }
Example #4
0
        public RenderObjectToWidgetElement <T> attachToRenderTree(BuildOwner owner,
                                                                  RenderObjectToWidgetElement <T> element)
        {
            if (element == null)
            {
                owner.lockState(() => {
                    element = (RenderObjectToWidgetElement <T>) this.createElement();
                    D.assert(element != null);
                    element.assignOwner(owner);
                });
                owner.buildScope(element, () => { element.mount(null, null); });
            }
            else
            {
                element._newWidget = this;
                element.markNeedsBuild();
            }

            return(element);
        }