Fix GridTileBar layout (#6844)
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user