Avoid known wide gallery title issues (#6534)
This commit is contained in:
parent
639ba0ddcb
commit
fc03057b1a
@ -37,6 +37,21 @@ class GridPhotoViewer extends StatefulWidget {
|
|||||||
_GridPhotoViewerState createState() => new _GridPhotoViewerState();
|
_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 {
|
class _GridPhotoViewerState extends State<GridPhotoViewer> with SingleTickerProviderStateMixin {
|
||||||
AnimationController _controller;
|
AnimationController _controller;
|
||||||
Animation<Offset> _flingAnimation;
|
Animation<Offset> _flingAnimation;
|
||||||
@ -180,7 +195,7 @@ class GridDemoPhotoItem extends StatelessWidget {
|
|||||||
header: new GestureDetector(
|
header: new GestureDetector(
|
||||||
onTap: () { onBannerTap(photo); },
|
onTap: () { onBannerTap(photo); },
|
||||||
child: new GridTileBar(
|
child: new GridTileBar(
|
||||||
title: new Text(photo.title),
|
title: new _GridTitleText(photo.title),
|
||||||
backgroundColor: Colors.black45,
|
backgroundColor: Colors.black45,
|
||||||
leading: new Icon(
|
leading: new Icon(
|
||||||
icon,
|
icon,
|
||||||
@ -197,8 +212,8 @@ class GridDemoPhotoItem extends StatelessWidget {
|
|||||||
onTap: () { onBannerTap(photo); },
|
onTap: () { onBannerTap(photo); },
|
||||||
child: new GridTileBar(
|
child: new GridTileBar(
|
||||||
backgroundColor: Colors.black45,
|
backgroundColor: Colors.black45,
|
||||||
title: new Text(photo.title),
|
title: new _GridTitleText(photo.title),
|
||||||
subtitle: new Text(photo.caption),
|
subtitle: new _GridTitleText(photo.caption),
|
||||||
trailing: new Icon(
|
trailing: new Icon(
|
||||||
icon,
|
icon,
|
||||||
color: Colors.white
|
color: Colors.white
|
||||||
|
@ -134,7 +134,7 @@ class LeaveBehindDemoState extends State<LeaveBehindDemo> {
|
|||||||
key: _scaffoldKey,
|
key: _scaffoldKey,
|
||||||
scrollableKey: _scrollableKey,
|
scrollableKey: _scrollableKey,
|
||||||
appBar: new AppBar(
|
appBar: new AppBar(
|
||||||
title: new Text('Swipe items to dismiss'),
|
title: new Text('Swipe to dismiss'),
|
||||||
actions: <Widget>[
|
actions: <Widget>[
|
||||||
new PopupMenuButton<LeaveBehindDemoAction>(
|
new PopupMenuButton<LeaveBehindDemoAction>(
|
||||||
onSelected: handleDemoAction,
|
onSelected: handleDemoAction,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user