Use an ellipsis to clip wide cards_demo titles (#4604)
This commit is contained in:
@@ -74,7 +74,11 @@ class TravelDestinationItem extends StatelessWidget {
|
||||
new Positioned(
|
||||
bottom: 16.0,
|
||||
left: 16.0,
|
||||
child: new Text(destination.title, style: titleStyle)
|
||||
child: new Text(destination.title,
|
||||
style: titleStyle,
|
||||
softWrap: false,
|
||||
overflow: TextOverflow.ellipsis
|
||||
)
|
||||
)
|
||||
]
|
||||
)
|
||||
@@ -83,14 +87,19 @@ class TravelDestinationItem extends StatelessWidget {
|
||||
new Flexible(
|
||||
child: new Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16.0, 16.0, 16.0, 0.0),
|
||||
child: new Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
// three line description
|
||||
new Text(destination.description[0], style: descriptionStyle),
|
||||
new Text(destination.description[1], style: descriptionStyle),
|
||||
new Text(destination.description[2], style: descriptionStyle),
|
||||
]
|
||||
child: new DefaultTextStyle(
|
||||
softWrap: false,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: descriptionStyle,
|
||||
child: new Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
// three line description
|
||||
new Text(destination.description[0]),
|
||||
new Text(destination.description[1]),
|
||||
new Text(destination.description[2]),
|
||||
]
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user