Exemple #1
0
        public void _layout(ConstraintType constraints)
        {
            owner.buildScope(this, () => {
                Widget built = null;
                if (widget.builder != null)
                {
                    try {
                        built = widget.builder(this, constraints);
                        WidgetsD.debugWidgetBuilderValue(widget, built);
                    } catch (Exception e) {
                        _debugDoingBuild = false;
                        IEnumerable <DiagnosticsNode> informationCollector()
                        {
                            yield return(new DiagnosticsDebugCreator(new DebugCreator(this)));
                        }
                        built = ErrorWidget.builder(WidgetsD._debugReportException("building " + this, e, informationCollector));
                    }
                }
                try {
                    _child = updateChild(_child, built, null);
                    D.assert(_child != null);
                } catch (Exception e) {
                    _debugDoingBuild = false;

                    IEnumerable <DiagnosticsNode> informationCollector()
                    {
                        yield return(new DiagnosticsDebugCreator(new DebugCreator(this)));
                    }
                    built = ErrorWidget.builder(WidgetsD._debugReportException("building " + this, e, informationCollector));
                }
            });
        }
Exemple #2
0
        void _layout(BoxConstraints constraints)
        {
            this.owner.buildScope(this, () => {
                Widget built = null;
                if (this.widget.builder != null)
                {
                    built = this.widget.builder(this, constraints);
                    WidgetsD.debugWidgetBuilderValue(this.widget, built);
                }

                this._child = this.updateChild(this._child, built, null);
                D.assert(this._child != null);
            });
        }