I have a new UI with 2 items.
If the text in the first item is too long, I need to wrap it to a new line like the screenshot.
I don’t know how to do.
Does anyone have a solution?
Thanks for your suggestion.
[UI screenshot]
(https://i.sstatic.net/kE1PCMrb.png)
I tried with Wrap widget but not working.
Here is current code:
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text("builder name"),
widget()
]
2
Answers
Text widget with softWrap and overflow properties. Wrap widget is useful for managing multiple widgets but may not work correctly for long text within a line.
Bind the text width so it knows when to wrap to the next line. To do this, I would recommend wrapping the Text Widget in an Expanded. As mentioned in the answer by Kasun you should also set softWrap to true. This should solve it for you.