How to set rounded border to a MaterialButton on Flutter?
If you need to use MaterialButton()
- You need to Warp the button with Material
Widget, to get the desired behavior.
Widget _showNeedHelpButton() {
return Padding(
padding: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 0.0),
child: Material( //Wrap with Material
shape: RoundedRectangleBorder(borderRadius:BorderRadius.circular(22.0) ),
elevation: 18.0,
color: Color(0xFF801E48),
clipBehavior: Clip.antiAlias, // Add This
child: MaterialButton(
minWidth: 200.0,
height: 35,
color: Color(0xFF801E48),
child: new Text('Preciso de ajuda',
style: new TextStyle(fontSize: 16.0, color: Colors.white)),
onPressed: () {
// setState(() {
// _isNeedHelp = true;
// });
},
),
),
);
}
Output:
UPDATE:
minWidth: 200.0,
height: 95,