Flutter 如何在颤振中创建带边框的圆形按钮?

Flutter 如何在颤振中创建带边框的圆形按钮?,flutter,dart,Flutter,Dart,我找到了具有此代码的: RawMaterialButton( onPressed: () {}, elevation: 2.0, fillColor: Colors.white, child: Icon( Icons.pause, size: 35.0, ), padding: EdgeInsets.all(15.0), shape: CircleBorder(), ) 这很好,但我不能插入带有颜色的边框。我无法找到任何插入边框的方法 在颤振中,在圆

我找到了具有此代码的:

RawMaterialButton(
  onPressed: () {},
  elevation: 2.0,
  fillColor: Colors.white,
  child: Icon(
    Icons.pause,
    size: 35.0,
  ),
  padding: EdgeInsets.all(15.0),
  shape: CircleBorder(),
)
这很好,但我不能插入带有颜色的边框。我无法找到任何插入边框的方法


在颤振中,在圆形按钮中插入边框的最简单方法是什么?

您可以通过将side属性应用于CircleOrder来设置边框。请参阅下面的代码

     RawMaterialButton(
      onPressed: () {},
      elevation: 2.0,
      fillColor: Colors.white,
      child: Icon(
        Icons.pause,
        size: 35.0,
      ),
      padding: EdgeInsets.all(15.0),
      shape: CircleBorder(
        side: BorderSide(width: 5, color: Colors.red, style: BorderStyle.solid),
      ),
    );

以下是如何设置按钮的边框:

形状:圆圈顺序(
侧面:边框侧面(宽度:5.0,样式:BorderStyle.solid,颜色:Colors.red)
),