'Flutter right overflow two texts in row
I want to put 2 Text in one Row. I do the following:
Row(crossAxisAlignment: CrossAxisAlignment.end, children: [
Flexible(
child: Text(text1,
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left)),
Flexible(
child: Text(text2,
maxLines: 1,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.left)),
]),
Here I have shown the result expected with overflows and actual:
None of the Text can expand more than half the total length of the Row, even if there is free space. How to implement the result I expect, despite the fact that the length of Text1 and Text2 may be different?
Solution 1:[1]
mainAxisAlignment: MainAxisAlignment.spaceBetween,
add MainAxisAlignment.spaceBetween for row it will put space between the text aligning them to left and right.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Sa9 |

