Lets say I have this TextButton:
TextButton(
style: TextButton.styleFrom(
minimumSize: const Size(newWidth, newHeight),
),
onPressed: _onTapped,
child: const Text('Button'),
),
Is there a way to set the minimum width while retaining whatever was the minimum height?
The motivation here is to keep the theme's values and overriding only what I need.
I was hoping that TextButton.defaultStyleOf(context) would be helpful alas it is not a static method.
Some notes:
I am not looking to use the old material buttons like FlatButton as they are being replaced with the new buttons (TextButton in this case), which is why I have this question in the first place.
But if there is a way to achieve that with MaterialButton, that would be good enough.