For example, we have next widget:
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
OutlinedButton(
child: Text('B 1'),
onPressed: () {},
),
OutlinedButton(
child: Text('BB 2'),
onPressed: () {},
),
OutlinedButton(
child: Text('BBBBB 5'),
onPressed: () {},
),
],
);
}
}
How can we create all buttons ('B1' and 'BB 2') to have the same width as the widest last one ('BBBBB 5'). So resulting MyWidget width will be the width of 'BBBBB 5' button multiply 3.
And yes, text on buttons can vary; that is why we can't precalculate and hardcode their width.
