@@ -15,9 +15,6 @@ class PestoDemo extends StatelessWidget {
1515 Widget build (BuildContext context) => new PestoHome ();
1616}
1717
18- const String _kUserName = 'Jonathan' ;
19- const String _kUserEmail = 'jonathan@example.com' ;
20- const String _kUserImage = 'packages/flutter_gallery_assets/pesto/avatar.jpg' ;
2118const String _kSmallLogoImage = 'packages/flutter_gallery_assets/pesto/logo_small.png' ;
2219const String _kMediumLogoImage = 'packages/flutter_gallery_assets/pesto/logo_medium.png' ;
2320const double _kAppBarHeight = 128.0 ;
@@ -79,11 +76,6 @@ class RecipeGridPage extends StatefulWidget {
7976
8077class _RecipeGridPageState extends State <RecipeGridPage > {
8178 final GlobalKey <ScaffoldState > scaffoldKey = new GlobalKey <ScaffoldState >();
82- final TextStyle favoritesMessageStyle = const PestoStyle (fontSize: 16.0 );
83- final TextStyle userStyle = const PestoStyle (fontWeight: FontWeight .bold);
84- final TextStyle emailStyle = const PestoStyle (color: Colors .black54);
85-
86- bool showFavorites = false ;
8779
8880 @override
8981 Widget build (BuildContext context) {
@@ -95,7 +87,6 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
9587 scrollableKey: config.scrollableKey,
9688 appBarBehavior: AppBarBehavior .under,
9789 appBar: buildAppBar (context, statusBarHeight),
98- drawer: buildDrawer (context),
9990 floatingActionButton: new FloatingActionButton (
10091 child: new Icon (Icons .edit),
10192 onPressed: () {
@@ -145,74 +136,9 @@ class _RecipeGridPageState extends State<RecipeGridPage> {
145136 );
146137 }
147138
148- Widget buildDrawer (BuildContext context) {
149- return new Drawer (
150- child: new Block (
151- children: < Widget > [
152- new DrawerHeader (
153- child: new Column (
154- mainAxisAlignment: MainAxisAlignment .center,
155- children: < Widget > [
156- new Container (
157- decoration: new BoxDecoration (
158- border: new Border .all (color: _kTheme.primaryColor, width: 2.0 ),
159- shape: BoxShape .circle
160- ),
161- width: 72.0 ,
162- height: 72.0 ,
163- padding: const EdgeInsets .all (2.0 ),
164- margin: const EdgeInsets .only (bottom: 16.0 ),
165- child: new ClipOval (
166- child: new Image .asset (_kUserImage, fit: ImageFit .contain)
167- )
168- ),
169- new Text (_kUserName, style: userStyle),
170- new Text (_kUserEmail, style: emailStyle)
171- ]
172- )
173- ),
174- new DrawerItem (
175- child: new Text ('Home' ),
176- icon: new Icon (Icons .home),
177- selected: ! showFavorites,
178- onPressed: () {
179- Navigator .popUntil (context, ModalRoute .withName ('/pesto' ));
180- }
181- ),
182- new DrawerItem (
183- child: new Text ('Favorites' ),
184- icon: new Icon (Icons .favorite),
185- selected: showFavorites,
186- onPressed: () {
187- if (showFavorites)
188- Navigator .pop (context);
189- else
190- showFavoritesPage (context);
191- }
192- ),
193- new Divider (),
194- new DrawerItem (
195- child: new Text ('Return to Gallery' ),
196- icon: new Icon (Icons .arrow_back),
197- onPressed: () {
198- Navigator .popUntil (context, ModalRoute .withName ('/' ));
199- }
200- ),
201- ]
202- )
203- );
204- }
205-
206139 Widget buildBody (BuildContext context, double statusBarHeight) {
207140 final EdgeInsets padding = new EdgeInsets .fromLTRB (8.0 , 8.0 + _kAppBarHeight + statusBarHeight, 8.0 , 8.0 );
208141
209- if (config.recipes.isEmpty) {
210- return new Padding (
211- padding: padding,
212- child: new Text ('Save your favorite recipes to see them here.' , style: favoritesMessageStyle)
213- );
214- }
215-
216142 return new ScrollableGrid (
217143 scrollableKey: config.scrollableKey,
218144 delegate: new MaxTileWidthGridDelegate (
0 commit comments