Commit fc03057b authored by Hans Muller's avatar Hans Muller Committed by Adam Barth

Avoid known wide gallery title issues (#6534)

parent 639ba0dd
......@@ -37,6 +37,21 @@ class GridPhotoViewer extends StatefulWidget {
_GridPhotoViewerState createState() => new _GridPhotoViewerState();
}
class _GridTitleText extends StatelessWidget {
_GridTitleText(this.text);
final String text;
@override
Widget build(BuildContext context) {
return new FittedBox(
fit: ImageFit.scaleDown,
alignment: FractionalOffset.centerLeft,
child: new Text(text),
);
}
}
class _GridPhotoViewerState extends State<GridPhotoViewer> with SingleTickerProviderStateMixin {
AnimationController _controller;
Animation<Offset> _flingAnimation;
......@@ -180,7 +195,7 @@ class GridDemoPhotoItem extends StatelessWidget {
header: new GestureDetector(
onTap: () { onBannerTap(photo); },
child: new GridTileBar(
title: new Text(photo.title),
title: new _GridTitleText(photo.title),
backgroundColor: Colors.black45,
leading: new Icon(
icon,
......@@ -197,8 +212,8 @@ class GridDemoPhotoItem extends StatelessWidget {
onTap: () { onBannerTap(photo); },
child: new GridTileBar(
backgroundColor: Colors.black45,
title: new Text(photo.title),
subtitle: new Text(photo.caption),
title: new _GridTitleText(photo.title),
subtitle: new _GridTitleText(photo.caption),
trailing: new Icon(
icon,
color: Colors.white
......
......@@ -134,7 +134,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
key: _scaffoldKey,
scrollableKey: _scrollableKey,
appBar: new AppBar(
title: new Text('Swipe items to dismiss'),
title: new Text('Swipe to dismiss'),
actions: <Widget>[
new PopupMenuButton<LeaveBehindDemoAction>(
onSelected: handleDemoAction,
......
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