美文网首页
flutter MaterialButton设置圆角

flutter MaterialButton设置圆角

作者: 東玖零 | 来源:发表于2021-09-10 15:38 被阅读0次

    直接上代码:

    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属性的控件都可以设置圆角。

    相关文章

      网友评论

          本文标题:flutter MaterialButton设置圆角

          本文链接:https://www.haomeiwen.com/subject/pqqnwltx.html