I have Column which consists of 2 Text widget in it and I tried to apply TextOverflow.ellipsis to the widgets when the string is too long. However, the overflow doesnt seems working as I stil get the "RenderFlex Overflow" error. Can anyone tell me how to solve this? The below is my sample code:
Row(children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(data.picodedesc,
overflow: TextOverflow.ellipsis,
softWrap: false,
maxLines: 1,
style: const TextStyle(fontSize: 12)),
Text(data.description,
overflow: TextOverflow.ellipsis,
maxLines: 1,
softWrap: false,
style: const TextStyle(
fontSize: 12,
overflow: TextOverflow.ellipsis))
],
),
)),
]
2
Answers
try below code
Try to wrap with
Expanded()
with yourRow()
widget, Otherwise You can set the fix width for yourRow()
widget withContainer()
orSizedBox()
.It’s look like below code :
Hope this solution might be work for you.