产生带有白色边框的OutlineButton:

OutlineButton(
  shape: RoundedRectangleBorder(
    side: BorderSide(
      color: Colors.purple
    )
  ),
)

产生带有紫色边框的FlatButton:
FlatButton(
  shape: RoundedRectangleBorder(
    side: BorderSide(
      color: Colors.purple
    )
  ),
)
OutlineButton的部分文档:

最佳答案

OutlineButton有一个名为borderSide的属性,您可以直接使用它:

        OutlineButton(
          borderSide: BorderSide(
              color: Colors.purple
            ),
        )

https://docs.flutter.io/flutter/material/OutlineButton/borderSide.html

关于Flutter:OutlineButton的side属性似乎无效,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/53107976/

10-11 15:26