I am trying to create square buttons, but Expanded doesn\'t seem to work the same as it does with containers. Take the following code for example
new Expanded(
Wrapping with a ButtonTheme
with minWidth: double.infinity
allows to provide constraints
ButtonTheme(
minWidth: double.infinity,
child: MaterialButton(
onPressed: () {},
child: Text('Raised Button'),
),
),
or after https://github.com/flutter/flutter/pull/19416 landed
MaterialButton(
onPressed: () {},
child: SizedBox.expand(
width: double.infinity,
child: Text('Raised Button'),
),
),