如何将边框颜色添加到OutlineButton

时间:2019-12-25 01:39:51

标签: flutter border flutter-layout

如何为边框按钮添加边框颜色?我尝试设置highlightedBorderColor,但无法正常工作。我该如何解决这个问题?

这是我的代码:

 OutlineButton(
   shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
   onPressed:(){},child: Padding(
   padding: const EdgeInsets.all(12),
   child: Text("add to cart",style: TextStyle(color: Colors.red,fontSize: 20),),
    ),highlightedBorderColor: Colors.red,
 ),

2 个答案:

答案 0 :(得分:1)

在代码中添加以下行:

azure.activedirectory.jwt-connect-timeout
azure.activedirectory.jwt-read-timeout
azure.activedirectory.jwt-size-limit

这应该将按钮的边框颜色更改为红色

答案 1 :(得分:0)

尝试一下:

      OutlineButton(
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(20),
          ),
          borderSide: BorderSide(color: Colors.pink, width: 1),
          onPressed: () {},
          child: Padding(
            padding: const EdgeInsets.all(12),
            child: Text(
              "add to cart",
              style: TextStyle(color: Colors.red, fontSize: 20),
            ),
          ),
        )