I followed the guide here: https://flutter.dev/docs/release/breaking-changes/buttons.
_buttonPreview(double _height, double _width) {
final ButtonStyle flatButtonStyle = TextButton.styleFrom(
minimumSize: Size(_width, _height),
backgroundColor: Colors.grey,
padding: EdgeInsets.all(0),
);
return TextButton(
style: flatButtonStyle,
onPressed: () {},
child: Text(
"some text",
style: TextStyle(color: Colors.white),
),
);
}