here you can see what I currently have: (I'm currently not allowed to insert this picture). I have two TabBars with two Radio Buttons each in a ListView, but it looks horrible. I would like to place the radio buttons one below the other, regardless of the length of the strings.
Here is my code:
return ListView(
children: <Widget>[
//..
),
Container(
child: ButtonBar(
alignment: MainAxisAlignment.spaceBetween, // I also tried every other setting here, but none works for me
children: <Widget>[
Radio(
value: 1,
groupValue: _selectedRadio,
activeColor: corpColorPrimary,
onChanged: (val) => setSelectedRadio(val),
),
Text("a long String"),
Radio(
value: 2,
groupValue: _selectedRadio,
activeColor: corpColorPrimary,
onChanged: (val) => setSelectedRadio(val),
),
Text("Another long String"),
],
)),
Container(
child: ButtonBar(
alignment: MainAxisAlignment.start,
children: <Widget>[
Radio(
value: 1,
groupValue: _selectedRadio,
activeColor: corpColorPrimary,
onChanged: (val) => setSelectedRadio(val),
),
Text("Hi"),
Radio(
value: 2,
groupValue: _selectedRadio,
activeColor: corpColorPrimary,
onChanged: (val) => setSelectedRadio(val),
),
Text(":)"),
],
),
),
RaisedButton(
child: Text("Next"),
onPressed: () {},
),
How can I align the Radio buttons correctly?
you can use
Spacer(),
widget between eachContainer(),
widget and adjust them.