From 02a448391436b47f5fb0e802a1d0a11390212aec Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Thu, 16 Jun 2016 17:24:06 -0400 Subject: [PATCH] Pesto: Fix app bar height when returning from recipe page. (#4579) The problem was that the Scaffold was getting a new key each time we navigated to the main page. The key influences where page state is stored, including the scroll offset. So for a single frame, the Scaffold incorrectly thinks the scroll offset is 0 and the app bar should be expanded. BUG=https://github.com/flutter/flutter/issues/4400 --- examples/flutter_gallery/lib/demo/pesto_demo.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/flutter_gallery/lib/demo/pesto_demo.dart b/examples/flutter_gallery/lib/demo/pesto_demo.dart index 1f48d83a22..65532cfa4c 100644 --- a/examples/flutter_gallery/lib/demo/pesto_demo.dart +++ b/examples/flutter_gallery/lib/demo/pesto_demo.dart @@ -51,7 +51,7 @@ class PestoDemo extends StatefulWidget { } class _PestoDemoState extends State { - final GlobalKey _scaffoldKey = new GlobalKey(); + static final GlobalKey _scaffoldKey = new GlobalKey(); final TextStyle favoritesMessageStyle = _textStyle(16.0); final TextStyle userStyle = _textStyle(12.0, FontWeight.bold); final TextStyle emailStyle = _textStyle(12.0).copyWith(color: Colors.black54); @@ -77,7 +77,7 @@ class _PestoDemoState extends State { Widget _buildAppBar(BuildContext context) { final double statusBarHeight = MediaQuery.of(context).padding.top; return new AppBar( - expandedHeight: 128.0, + expandedHeight: _kAppBarHeight, actions: [ new IconButton( icon: Icons.search,