直接上代码:
Container(
width: double.infinity,
margin: EdgeInsets.all(15),
height: 47,
child: MaterialButton(
color: Colors.blue,
textColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
onPressed: () {},
child: Text("确认付款"),
),
)
主要代码:
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
shape的定义:
final ShapeBorder? shape;
猜测有shape属性的控件都可以设置圆角。
网友评论