Commit f496ad05 authored by Hans Muller's avatar Hans Muller Committed by GitHub

Fix GridTileBar layout (#6844)

parent d8e6de8e
......@@ -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),
),
),
);
}
));
......
......@@ -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(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment