Remove pop in AppBar hero animations (#5243)

Now the flexible space bar computes its effect from its size rather than from
the Scaffold's animation.
This commit is contained in:
Adam Barth
2016-08-05 09:30:45 -07:00
committed by GitHub
parent d2b3976110
commit 4cc094ac9f
3 changed files with 71 additions and 76 deletions

View File

@@ -42,13 +42,14 @@ class _AppBarBackground extends StatelessWidget {
@override
Widget build(BuildContext context) {
Animation<double> effectiveAnimation = animation ?? kAlwaysCompleteAnimation;
return new AnimatedBuilder(
animation: animation,
animation: effectiveAnimation,
builder: (BuildContext context, Widget child) {
return new Stack(
children: _kBackgroundLayers.map((_BackgroundLayer layer) {
return new Positioned(
top: -layer.parallaxTween.evaluate(animation),
top: -layer.parallaxTween.evaluate(effectiveAnimation),
left: 0.0,
right: 0.0,
bottom: 0.0,
@@ -147,7 +148,7 @@ class GalleryHomeState extends State<GalleryHome> {
background: new Builder(
builder: (BuildContext context) {
return new _AppBarBackground(
animation: Scaffold.of(context).appBarAnimation
animation: Scaffold.of(context)?.appBarAnimation
);
}
)