其他分享
首页 > 其他分享> > Flutter ButtonStyle设置圆角

Flutter ButtonStyle设置圆角

作者:互联网

ElevatedButton(
    child: Text(
      '提交',
      style: TextStyle(
          fontWeight: FontWeight.bold,
          color: Colors.white[300],
          fontSize: 14),
    ),
    onPressed: () {print("提交");}
    style: ButtonStyle(
        //圆角
        shape: MaterialStateProperty.all(
            RoundedRectangleBorder(
                borderRadius:
                    BorderRadius.circular(
                        20))),
        //边框
        side: MaterialStateProperty.all(
          BorderSide(
              color: Colors.red,
              width: 0.5),
        ),
        //背景
        backgroundColor:
            MaterialStateProperty.all(
                Colors.blue[200])),
)

标签:圆角,color,style,MaterialStateProperty,Colors,ButtonStyle,Flutter
来源: https://blog.csdn.net/qq_31754523/article/details/122766438