diff --git a/examples/flutter_gallery/lib/demo/grid_list_demo.dart b/examples/flutter_gallery/lib/demo/grid_list_demo.dart index 4043bd9135..591757eebd 100644 --- a/examples/flutter_gallery/lib/demo/grid_list_demo.dart +++ b/examples/flutter_gallery/lib/demo/grid_list_demo.dart @@ -164,10 +164,12 @@ class GridDemoPhotoItem extends StatelessWidget { appBar: new AppBar( title: new Text(photo.title) ), - body: new Hero( - tag: photo.tag, - child: new GridPhotoViewer(photo: photo), - ) + body: new SizedBox.expand( + child: new Hero( + tag: photo.tag, + child: new GridPhotoViewer(photo: photo), + ), + ), ); } )); diff --git a/packages/flutter/lib/src/material/grid_tile_bar.dart b/packages/flutter/lib/src/material/grid_tile_bar.dart index d40d61cb62..db72fc79cc 100644 --- a/packages/flutter/lib/src/material/grid_tile_bar.dart +++ b/packages/flutter/lib/src/material/grid_tile_bar.dart @@ -64,15 +64,11 @@ class GridTileBar extends StatelessWidget { if (backgroundColor != null) decoration = new BoxDecoration(backgroundColor: backgroundColor); - EdgeInsets padding; - if (leading != null && trailing != null) - padding = const EdgeInsets.symmetric(vertical: 16.0, horizontal: 8.0); - else if (leading != null) - padding = const EdgeInsets.only(left: 8.0, right: 16.0, top: 16.0, bottom: 16.0); - else // trailing != null || (leading == null && trailing == null) - padding = const EdgeInsets.only(left: 16.0, right: 8.0, top: 16.0, bottom: 16.0); - final List children = []; + final EdgeInsets padding = new EdgeInsets.only( + left: leading != null ? 8.0 : 16.0, + right: trailing != null ? 8.0 : 16.0, + ); if (leading != null) children.add(new Padding(padding: const EdgeInsets.only(right: 8.0), child: leading)); @@ -87,6 +83,7 @@ class GridTileBar extends StatelessWidget { children.add( new Flexible( child: new Column( + mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, children: [ new DefaultTextStyle( @@ -124,6 +121,7 @@ class GridTileBar extends StatelessWidget { return new Container( padding: padding, decoration: decoration, + height: (title != null && subtitle != null) ? 68.0 : 48.0, child: new Theme( data: darkTheme, child: new IconTheme.merge(