Beispiel #1
0
    void _createAnimationController()
    {
        _animationController = new AnimationController(vsync: this, value: 0.5f);
        Tween <float> tween = new FloatTween(begin: 0.0f, end: 1.0f);

        _animation = tween.animate(_animationController);
    }
Beispiel #2
0
        void _createAnimationController()
        {
            this._animationController = new AnimationController(vsync: this, value: 0.5f);
            FloatTween tween = new FloatTween(0.0f, 1.0f);

            this._animation = tween.animate(parent: this._animationController);
        }
Beispiel #3
0
        public override Widget build(BuildContext context)
        {
            return(new LayoutBuilder(
                       builder: (BuildContext _context, BoxConstraints constraints) => {
                Size size = constraints.biggest;

                CurvedAnimation primaryAnimation = new CurvedAnimation(
                    parent: animation,
                    curve: _transitionCurve,
                    reverseCurve: _transitionCurve.flipped
                    );

                Animation <float> clipAnimation = new FloatTween(
                    begin: 0.0f,
                    end: size.height
                    ).animate(primaryAnimation);

                Animation <float> opacityAnimation = _scrimOpacityTween.animate(primaryAnimation);
                Animation <Offset> primaryTranslationAnimation = _primaryTranslationTween.animate(primaryAnimation);

                Animation <Offset> secondaryTranslationAnimation = _secondaryTranslationTween.animate(
                    new CurvedAnimation(
                        parent: secondaryAnimation,
                        curve: _transitionCurve,
                        reverseCurve: _transitionCurve.flipped
                        )
                    );

                return new AnimatedBuilder(
                    animation: animation,
                    builder: (BuildContext _, Widget child) => {
                    return new Container(
                        color: Colors.black.withOpacity(opacityAnimation.value),
                        alignment: Alignment.bottomLeft,
                        child: new ClipRect(
                            child: new SizedBox(
                                height: clipAnimation.value,
                                child: new OverflowBox(
                                    alignment: Alignment.bottomLeft,
                                    maxHeight: size.height,
                                    child: child
                                    )
                                )
                            )
                        );
                },
                    child: new AnimatedBuilder(
                        animation: secondaryAnimation,
                        child: new FractionalTranslation(
                            translation: primaryTranslationAnimation.value,
                            child: this.child
                            ),
                        builder: (BuildContext _, Widget child) => {
                    return new FractionalTranslation(
                        translation: secondaryTranslationAnimation.value,
                        child: child
                        );
                }
                        )
                    );
            }
                       ));
        }