Skip to content

Commit 46b6077

Browse files
Update Gallery usage of Scaffold.of (flutter#6639)
1 parent e7d5c7d commit 46b6077

File tree

1 file changed

+3
-3
lines changed
  • examples/flutter_gallery/lib/gallery

1 file changed

+3
-3
lines changed

examples/flutter_gallery/lib/gallery/home.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class GalleryHome extends StatefulWidget {
9999
}
100100

101101
class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderStateMixin {
102-
static final Key _homeKey = new ValueKey<String>('Gallery Home');
102+
static final GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
103103
static final GlobalKey<ScrollableState> _scrollableKey = new GlobalKey<ScrollableState>();
104104

105105
AnimationController _controller;
@@ -148,7 +148,7 @@ class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderState
148148
Widget build(BuildContext context) {
149149
final double statusBarHeight = MediaQuery.of(context).padding.top;
150150
Widget home = new Scaffold(
151-
key: _homeKey,
151+
key: _scaffoldKey,
152152
scrollableKey: _scrollableKey,
153153
drawer: new GalleryDrawer(
154154
useLightTheme: config.useLightTheme,
@@ -166,7 +166,7 @@ class GalleryHomeState extends State<GalleryHome> with SingleTickerProviderState
166166
background: new Builder(
167167
builder: (BuildContext context) {
168168
return new _AppBarBackground(
169-
animation: Scaffold.of(context)?.appBarAnimation
169+
animation: _scaffoldKey.currentState.appBarAnimation
170170
);
171171
}
172172
)

0 commit comments

Comments
 (0)