Update Gallery usage of Scaffold.of (#6639)

This commit is contained in:
Jason Simmons 2016-11-03 17:26:36 -07:00 committed by GitHub
parent e7d5c7d6b7
commit 46b60773e8

View File

@ -99,7 +99,7 @@ class GalleryHome extends StatefulWidget {
} }
class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStateMixin { class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStateMixin {
static final Key _homeKey = new ValueKey<String>('Gallery Home'); static final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
static final GlobalKey<ScrollableState> _scrollableKey = new GlobalKey<ScrollableState>(); static final GlobalKey<ScrollableState> _scrollableKey = new GlobalKey<ScrollableState>();
AnimationController _controller; AnimationController _controller;
@ -148,7 +148,7 @@ class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderState
Widget build(BuildContext context) { Widget build(BuildContext context) {
final double statusBarHeight = MediaQuery.of(context).padding.top; final double statusBarHeight = MediaQuery.of(context).padding.top;
Widget home = new Scaffold( Widget home = new Scaffold(
key: _homeKey, key: _scaffoldKey,
scrollableKey: _scrollableKey, scrollableKey: _scrollableKey,
drawer: new GalleryDrawer( drawer: new GalleryDrawer(
useLightTheme: config.useLightTheme, useLightTheme: config.useLightTheme,
@ -166,7 +166,7 @@ class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderState
background: new Builder( background: new Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return new _AppBarBackground( return new _AppBarBackground(
animation: Scaffold.of(context)?.appBarAnimation animation: _scaffoldKey.currentState.appBarAnimation
); );
} }
) )