예제 #1
0
 public override Widget build(BuildContext context)
 {
     if (maintainSize)
     {
         Widget result = sliver;
         if (!maintainInteractivity)
         {
             result = new SliverIgnorePointer(
                 sliver: sliver,
                 ignoring: !visible
                 );
         }
         return(new SliverOpacity(
                    opacity: visible ? 1.0f : 0.0f,
                    sliver: result
                    ));
     }
     D.assert(!maintainInteractivity);
     D.assert(!maintainSize);
     if (maintainState)
     {
         Widget result = sliver;
         if (!maintainAnimation)
         {
             result = new TickerMode(child: sliver, enabled: visible);
         }
         return(new SliverOffstage(
                    sliver: result,
                    offstage: !visible
                    ));
     }
     D.assert(!maintainAnimation);
     D.assert(!maintainState);
     return(visible ? sliver : replacementSliver);
 }
예제 #2
0
 public override Widget build(BuildContext context)
 {
     return(new _EffectiveTickerMode(
                enabled: enabled && TickerMode.of(context),
                child: child
                ));
 }
예제 #3
0
        public override void didChangeDependencies()
        {
            if (this._ticker != null) {
                this._ticker.muted = !TickerMode.of(this.context);
            }

            base.didChangeDependencies();
        }
예제 #4
0
        public override void didChangeDependencies()
        {
            bool muted = !TickerMode.of(this.context);
            if (this._tickers != null) {
                foreach (Ticker ticker in this._tickers) {
                    ticker.muted = muted;
                }
            }

            base.didChangeDependencies();
        }
예제 #5
0
        public override void didChangeDependencies()
        {
            _updateInvertColors();
            _resolveImage();

            if (TickerMode.of(context: context))
            {
                _listenToStream();
            }
            else
            {
                _stopListeningToStream();
            }

            base.didChangeDependencies();
        }
예제 #6
0
        public override void didChangeDependencies()
        {
            this._invertColors = false;

            this._resolveImage();

            if (TickerMode.of(this.context))
            {
                this._listenToStream();
            }
            else
            {
                this._stopListeningToStream();
            }

            base.didChangeDependencies();
        }
예제 #7
0
        public override Widget build(BuildContext context)
        {
            if (maintainSize)
            {
                Widget result = child;
                if (!maintainInteractivity)
                {
                    result = new IgnorePointer(
                        child: child,
                        ignoring: !visible
                        //todo : ignoringSemantics: !visible && !maintainSemantics,
                        );
                }

                return(new Opacity(
                           opacity: visible ? 1.0f : 0.0f,
                           //alwaysIncludeSemantics: maintainSemantics,
                           child: result
                           ));
            }

            D.assert(!maintainInteractivity);
            D.assert(!maintainSemantics);
            D.assert(!maintainSize);

            if (maintainState)
            {
                Widget result = child;
                if (!maintainAnimation)
                {
                    result = new TickerMode(child: child, enabled: visible);
                }

                return(new Offstage(
                           child: result,
                           offstage: !visible
                           ));
            }
            D.assert(!maintainAnimation);
            D.assert(!maintainState);
            return(visible ? child : replacement);
        }
예제 #8
0
        public override Widget build(BuildContext context)
        {
            if (this.maintainSize)
            {
                Widget result = this.child;
                if (!this.maintainInteractivity)
                {
                    result = new IgnorePointer(
                        child: this.child,
                        ignoring: !this.visible
                        );
                }

                return(new Opacity(
                           opacity: this.visible ? 1.0f : 0.0f,
                           child: result
                           ));
            }

            D.assert(!this.maintainInteractivity);
            D.assert(!this.maintainSize);
            if (this.maintainState)
            {
                Widget result = this.child;
                if (!this.maintainAnimation)
                {
                    result = new TickerMode(child: this.child, enabled: this.visible);
                }

                return(new Offstage(
                           child: result,
                           offstage: !this.visible
                           ));
            }

            D.assert(!this.maintainAnimation);
            D.assert(!this.maintainState);
            return(this.visible ? this.child : this.replacement);
        }
예제 #9
0
        public override Widget build(BuildContext context)
        {
            Key  kFirstChildKey        = new ValueKey <CrossFadeState>(CrossFadeState.showFirst);
            Key  kSecondChildKey       = new ValueKey <CrossFadeState>(CrossFadeState.showSecond);
            bool transitioningForwards = this._controller.status == AnimationStatus.completed ||
                                         this._controller.status == AnimationStatus.forward;

            Key               topKey;
            Widget            topChild;
            Animation <float> topAnimation;
            Key               bottomKey;
            Widget            bottomChild;
            Animation <float> bottomAnimation;

            if (transitioningForwards)
            {
                topKey          = kSecondChildKey;
                topChild        = this.widget.secondChild;
                topAnimation    = this._secondAnimation;
                bottomKey       = kFirstChildKey;
                bottomChild     = this.widget.firstChild;
                bottomAnimation = this._firstAnimation;
            }
            else
            {
                topKey          = kFirstChildKey;
                topChild        = this.widget.firstChild;
                topAnimation    = this._firstAnimation;
                bottomKey       = kSecondChildKey;
                bottomChild     = this.widget.secondChild;
                bottomAnimation = this._secondAnimation;
            }

            bottomChild = new TickerMode(
                key: bottomKey,
                enabled: this._isTransitioning,
                child: new FadeTransition(
                    opacity: bottomAnimation,
                    child: bottomChild
                    )
                );

            topChild = new TickerMode(
                key: topKey,
                enabled: true,
                child: new FadeTransition(
                    opacity: topAnimation,
                    child: topChild
                    )
                );

            return(new ClipRect(
                       child: new AnimatedSize(
                           alignment: this.widget.alignment,
                           duration: this.widget.duration,
                           curve: this.widget.sizeCurve,
                           vsync: this,
                           child: this.widget.layoutBuilder(topChild, topKey, bottomChild, bottomKey)
                           )
                       ));
        }