Flutter – two text in a row with left one overflowing gracefully
You can use the Flexible
widget:
Widget _listItemSubtitle(String subtitle) {
return new Flexible(
fit: FlexFit.loose,
child: Text(
"[$subtitle]",
softWrap: false,
overflow: TextOverflow.fade,
),
);
}
Alternative:
If you prefer that the time widget is always on the right, you could wrap the subtitle text in an Expanded
widget:
Widget _listItemSubtitle(String subtitle){
return Expanded(
child: Text(
"[$subtitle]",
softWrap: false,
overflow: TextOverflow.fade,
),
);
}