Exemple #1
0
 void _layoutUnstable()
 {
     if (this._sizeTween.end != this.child.size)
     {
         this._sizeTween.begin = this._sizeTween.end = this.debugAdoptSize(this.child.size);
         this._restartAnimation();
     }
     else
     {
         this._controller.stop();
         this._state = RenderAnimatedSizeState.stable;
     }
 }
Exemple #2
0
 void _layoutUnstable()
 {
     if (_sizeTween.end != child.size)
     {
         _sizeTween.begin = _sizeTween.end = debugAdoptSize(child.size);
         _restartAnimation();
     }
     else
     {
         _controller.stop();
         _state = RenderAnimatedSizeState.stable;
     }
 }
Exemple #3
0
 void _layoutChanged()
 {
     if (this._sizeTween.end != this.child.size)
     {
         this._sizeTween.begin = this._sizeTween.end = this.debugAdoptSize(this.child.size);
         this._restartAnimation();
         this._state = RenderAnimatedSizeState.unstable;
     }
     else
     {
         this._state = RenderAnimatedSizeState.stable;
         if (!this._controller.isAnimating)
         {
             this._controller.forward();
         }
     }
 }
Exemple #4
0
 void _layoutChanged()
 {
     if (_sizeTween.end != child.size)
     {
         _sizeTween.begin = _sizeTween.end = debugAdoptSize(child.size);
         _restartAnimation();
         _state = RenderAnimatedSizeState.unstable;
     }
     else
     {
         _state = RenderAnimatedSizeState.stable;
         if (!_controller.isAnimating)
         {
             _controller.forward();
         }
     }
 }
Exemple #5
0
        protected override void performLayout()
        {
            _lastValue         = _controller.value;
            _hasVisualOverflow = false;
            BoxConstraints constraints = this.constraints;

            if (child == null || constraints.isTight)
            {
                _controller.stop();
                size   = _sizeTween.begin = _sizeTween.end = constraints.smallest;
                _state = RenderAnimatedSizeState.start;
                child?.layout(constraints);
                return;
            }

            child.layout(constraints, parentUsesSize: true);

            switch (_state)
            {
            case RenderAnimatedSizeState.start:
                _layoutStart();
                break;

            case RenderAnimatedSizeState.stable:
                _layoutStable();
                break;

            case RenderAnimatedSizeState.changed:
                _layoutChanged();
                break;

            case RenderAnimatedSizeState.unstable:
                _layoutUnstable();
                break;
            }

            size = constraints.constrain(_animatedSize);
            alignChild();

            if (size.width < _sizeTween.end.width ||
                size.height < _sizeTween.end.height)
            {
                _hasVisualOverflow = true;
            }
        }
Exemple #6
0
 void _layoutStable()
 {
     if (this._sizeTween.end != this.child.size)
     {
         this._sizeTween.begin = this.size;
         this._sizeTween.end   = this.debugAdoptSize(this.child.size);
         this._restartAnimation();
         this._state = RenderAnimatedSizeState.changed;
     }
     else if (this._controller.value == this._controller.upperBound)
     {
         this._sizeTween.begin = this._sizeTween.end = this.debugAdoptSize(this.child.size);
     }
     else if (!this._controller.isAnimating)
     {
         this._controller.forward();
     }
 }
Exemple #7
0
 void _layoutStable()
 {
     if (_sizeTween.end != child.size)
     {
         _sizeTween.begin = size;
         _sizeTween.end   = debugAdoptSize(child.size);
         _restartAnimation();
         _state = RenderAnimatedSizeState.changed;
     }
     else if (_controller.value == _controller.upperBound)
     {
         _sizeTween.begin = _sizeTween.end = debugAdoptSize(child.size);
     }
     else if (!_controller.isAnimating)
     {
         _controller.forward();
     }
 }
Exemple #8
0
        protected override void performLayout()
        {
            this._lastValue         = this._controller.value;
            this._hasVisualOverflow = false;

            if (this.child == null || this.constraints.isTight)
            {
                this._controller.stop();
                this.size   = this._sizeTween.begin = this._sizeTween.end = this.constraints.smallest;
                this._state = RenderAnimatedSizeState.start;
                this.child?.layout(this.constraints);
                return;
            }

            this.child.layout(this.constraints, parentUsesSize: true);

            switch (this._state)
            {
            case RenderAnimatedSizeState.start:
                this._layoutStart();
                break;

            case RenderAnimatedSizeState.stable:
                this._layoutStable();
                break;

            case RenderAnimatedSizeState.changed:
                this._layoutChanged();
                break;

            case RenderAnimatedSizeState.unstable:
                this._layoutUnstable();
                break;
            }

            this.size = this.constraints.constrain(this._animatedSize);
            this.alignChild();

            if (this.size.width < this._sizeTween.end.width ||
                this.size.height < this._sizeTween.end.height)
            {
                this._hasVisualOverflow = true;
            }
        }
Exemple #9
0
 void _layoutStart()
 {
     this._sizeTween.begin = this._sizeTween.end = this.debugAdoptSize(this.child.size);
     this._state           = RenderAnimatedSizeState.stable;
 }
Exemple #10
0
 void _layoutStart()
 {
     _sizeTween.begin = _sizeTween.end = debugAdoptSize(child.size);
     _state           = RenderAnimatedSizeState.stable;
 }