Reputation: 483
I'm trying to align the widgets inside the column to be in the center with CrossAxisAlignment.center but I also want that the Widgets have the same width. How can I achieve this?
Upvotes: 17
Views: 10188
Reputation: 31326
you can get something similar to that by setting the CrossAxisAlignment
to stretch and then wrap the Column
in a IntrinsicWidth
and if you want to give them a specific width use the stepWidth
property
Center(
child: IntrinsicWidth(
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
RaisedButton(
child: Text("hello"),
onPressed: () {},
),
RaisedButton(
child: Text("another hello"),
onPressed: () {},
),
RaisedButton(
child: Text("DB"),
onPressed: () {},
),
],
),
),
),
Upvotes: 52