What is needed to take all the vertical space for the red square and text(cover yellow part)?
return (Container(
height: 50,
color: Colors.amber[colorCodes[index % 2]],
child: Row(children: [
//Center(child: Text(entries[index])),
Expanded(
child: Container(child:
const Column(
children: [
Row(children: [
Expanded(
flex: 8,
child: DecoratedBox(
decoration: BoxDecoration(color: Colors.red),
child: Text("hello"))),
Expanded(flex: 4, child: Text("world")),
]),
Expanded(
child: Align(
alignment: Alignment.bottomLeft,
child: LinearProgressIndicator(
minHeight: 3,
backgroundColor: Colors.redAccent,
value: 0.50)))
],
))),
])
//child: Center(child: LinearProgressIndicator(backgroundColor: Colors.greenAccent,value: 20))
));
}),
);
2
Answers
You can use
crossAxisAlignment: CrossAxisAlignment.stretch,
on Row.You can add an Expanded widget to the DecoratedBox and the Text widgets in the Row children, in order to make them take the available space