From b71d7694ab2f480943bbd15afc088f8f2ea06ec5 Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Thu, 8 Sep 2016 16:40:11 -0400 Subject: [PATCH] Prevent Hero transition for AppBar on Pesto recipe page. (#5760) BUG=https://github.com/flutter/flutter/issues/5351 --- examples/flutter_gallery/lib/demo/pesto_demo.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/examples/flutter_gallery/lib/demo/pesto_demo.dart b/examples/flutter_gallery/lib/demo/pesto_demo.dart index a0f49a2ed93..6d47de42b98 100644 --- a/examples/flutter_gallery/lib/demo/pesto_demo.dart +++ b/examples/flutter_gallery/lib/demo/pesto_demo.dart @@ -317,6 +317,7 @@ class _RecipePageState extends State { final GlobalKey _scaffoldKey = new GlobalKey(); final GlobalKey _scrollableKey = new GlobalKey(); final TextStyle menuItemStyle = new PestoStyle(fontSize: 15.0, color: Colors.black54, height: 24.0/15.0); + final Object _disableHeroTransition = new Object(); double _getAppBarHeight(BuildContext context) => MediaQuery.of(context).size.height * 0.3; @@ -327,6 +328,7 @@ class _RecipePageState extends State { scrollableKey: _scrollableKey, appBarBehavior: AppBarBehavior.scroll, appBar: new AppBar( + heroTag: _disableHeroTransition, expandedHeight: _getAppBarHeight(context), backgroundColor: Colors.transparent, elevation: 0, @@ -346,9 +348,6 @@ class _RecipePageState extends State { ] ) ], - // This empty space keeps the app bar from moving until the screen is - // scrolled at least _getAppBarHeight(). - flexibleSpace: new Container() ), body: _buildContainer(context) );