Ejemplo n.º 1
0
        public static bool recommendDeferredLoadingForContext(BuildContext context)
        {
            _ScrollableScope widget = context.getElementForInheritedWidgetOfExactType <_ScrollableScope>()?.widget as _ScrollableScope;

            if (widget == null)
            {
                return(false);
            }

            return(widget.position.recommendDeferredLoading(context));
        }
Ejemplo n.º 2
0
        public override Widget build(BuildContext context)
        {
            D.assert(this.position != null);

            Widget result = new _ScrollableScope(
                scrollable: this,
                position: this.position,
                child: new RawGestureDetector(
                    key: this._gestureDetectorKey,
                    gestures: this._gestureRecognizers,
                    behavior: HitTestBehavior.opaque,
                    child: new IgnorePointer(
                        key: this._ignorePointerKey,
                        ignoring: this._shouldIgnorePointer,
                        child: this.widget.viewportBuilder(context, this.position)
                        )
                    )
                );

            return(this._configuration.buildViewportChrome(context, result, this.widget.axisDirection));
        }
Ejemplo n.º 3
0
        public static ScrollableState of(BuildContext context)
        {
            _ScrollableScope widget = context.dependOnInheritedWidgetOfExactType <_ScrollableScope>();

            return(widget == null ? null : widget.scrollable);
        }
Ejemplo n.º 4
0
        public static ScrollableState of(BuildContext context)
        {
            _ScrollableScope widget = (_ScrollableScope)context.inheritFromWidgetOfExactType(typeof(_ScrollableScope));

            return(widget == null ? null : widget.scrollable);
        }