I have a Row
that looks like this:
SizedBox(
height: 64,
child: Row(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
Expanded(
child: Container(
color: Colors.blue,
child: Text("looooooooong", softWrap: false))),
Expanded(
child: Container(
color: Colors.green, child: Text("short", softWrap: false)))
]));
As you can see the text in the blue container gets cut of.
Building the same thing with CSS look like this:
#container {
width: 100px;
height: 64px;
display: flex;
align-items: stretch;
}
#first {
flex-grow: 1;
background-color: blue;
}
#second {
flex-grow: 1;
background-color: green;
}
<div id="container">
<div id="first">looooooooong</div>
<div id="second">short</div>
</div>
In this case the green container leaves its unused space over to the blue container and the text in the blue container doesn't get cut of.
How am I supposed to achieve the CSS flex-box behavior in Flutter?