Fix GridTileBar layout (#6844)

This commit is contained in:
Hans Muller
2016-11-15 12:01:27 -08:00
committed by GitHub
parent d8e6de8ec7
commit f496ad055a
2 changed files with 12 additions and 12 deletions

View File

@@ -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),
),
),
);
}
));

View File

@@ -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<Widget> children = <Widget>[];
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: <Widget>[
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(