Ease Material route animations (#5487)

This commit is contained in:
Hans Muller
2016-08-19 10:01:14 -07:00
committed by GitHub
parent 03b117a5e5
commit 243b4c065b
2 changed files with 7 additions and 4 deletions

View File

@@ -18,8 +18,11 @@ class _MaterialPageTransition extends AnimatedWidget {
this.child
}) : super(
key: key,
animation: _kMaterialPageTransitionTween.animate(new CurvedAnimation(parent: animation, curve: Curves.fastOutSlowIn))
);
animation: _kMaterialPageTransitionTween.animate(new CurvedAnimation(
parent: animation, // The route's linear 0.0 - 1.0 animation.
curve: Curves.fastOutSlowIn
)
));
final Widget child;

View File

@@ -447,7 +447,7 @@ class HeroController extends NavigatorObserver {
if (previousRoute is PageRoute<dynamic>) // could be null
_from = previousRoute;
_to = route;
_animation = route.animation;
_animation = new CurvedAnimation(parent: route.animation, curve: Curves.fastOutSlowIn);
_checkForHeroQuest();
}
}
@@ -461,7 +461,7 @@ class HeroController extends NavigatorObserver {
if (previousRoute is PageRoute<dynamic>) {
_to = previousRoute;
_from = route;
_animation = route.animation;
_animation = new CurvedAnimation(parent: route.animation, curve: Curves.fastOutSlowIn);
_checkForHeroQuest();
}
}