如何使按钮的角仅在顶部变圆?

时间:2018-11-04 08:19:39

标签: dart flutter flutter-layout

我正在尝试创建一个按钮,该按钮的顶部为圆角,底部为标准角。我怎么能这样呢?

1 个答案:

答案 0 :(得分:4)

一般示例:

RaisedButton(
              onPressed: () {},
              shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.only(
                      topLeft: Radius.circular(15.0),
                      topRight: Radius.circular(15.0))),
              child: Text('Click Me!'),
              color: Colors.blueAccent,
              textColor: Colors.white,
            ),

根据pskink评论:

RaisedButton(
              onPressed: () {},
              shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.vertical(
                top: Radius.circular(15.0),
              )),
              child: Text('Click Me!'),
              color: Colors.blueAccent,
              textColor: Colors.white,
            ),