【发布时间】:2019-07-16 15:05:23
【问题描述】:
我正在尝试为我的MaterialButton 设置圆角边框,为此我将RoundedRectangleBorder 设置为形状属性的MaterialButton,问题是它没有效果。
代码:
Widget _showNeedHelpButton() {
return new Padding(
padding: EdgeInsets.fromLTRB(0.0, 5.0, 0.0, 0.0),
child: new MaterialButton(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20.0))),
elevation: 5.0,
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;
});
},
),
);
}
结果:
【问题讨论】:
-
请问您的问题与这个问题有多大不同? stackoverflow.com/questions/47423297/…
-
MaterialButton小部件有一个shape属性,我想使用它,而不是像Container这样的其他小部件。