I have a design like Pic 1,and my problem is that the text will be wrapped in a Container with background gradient, but since i’m using the Expanded to wrap this Container, so it’s always get all the empty space like picture 2,which won’t match the design.
If i’m using the Flexible,how can i align the arrow icon to the end of row as show in picture 3.
Please help me to find a solution, tks.
Container(
width: 400,
height: 300,
color: Colors.blue,
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
Flexible(
child: Container(
color: Colors.white,
child: Text("Công thực tế:21 công"))),
Align(
alignment: Alignment.topRight,
child: Icon(Icons.arrow_circle_right))
],
),
)
],
),
),
[Pic 1](https://i.stack.imgur.com/2HWAZ.png)
[Pic 2](https://i.stack.imgur.com/m5aQy.png)
[pic 3](https://i.stack.imgur.com/XUrrR.png)
Find a solution for this code
2
Answers
Ah, nevermind, i just found a solution, using the Flexible and MainAxisAlignment.spaceBetween, i will put my code below, thanks for your help.
you can try this:
output