How can I make the following buttons the same width as the widest one (in this case the last one)? I don't want to hardcode to make all equal to the last one, because, e.g., when switched to a different language, it might not be the last button that is widest.
The code I am using:
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
children: [
Spacer(flex: 1),
Text(
'Flutter Test',
style: Theme.of(context).textTheme.headline1,
),
Spacer(flex: 2),
Row(
mainAxisSize: MainAxisSize.max,
children: [
Expanded(child:
Column(
children: [
ElevatedButton(
onPressed: () {
},
child: Text('Apple'),
),
ElevatedButton(
onPressed: () {
},
child: Text('Banana'),
),
ElevatedButton(
onPressed: () {
},
child: Text('Chery'),
),
ElevatedButton(
onPressed: () {
},
child: Text('Durian'),
),
ElevatedButton(
onPressed: () {
Navigator.pop(context);
},
child: Text('Emu apple fruit'),
),
],
),
),
],
),
Spacer(flex: 3),
],
),
),
);
}
Thanks!

