Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dart 如何制作按钮';s角只在顶部圆?_Dart_Flutter_Flutter Layout - Fatal编程技术网

Dart 如何制作按钮';s角只在顶部圆?

Dart 如何制作按钮';s角只在顶部圆?,dart,flutter,flutter-layout,Dart,Flutter,Flutter Layout,我想做一个按钮,上面有圆角,底部有正常的角。我怎样才能做到这样 一般示例: RaisedButton( onPressed: () {}, shape: RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: Radius.circular(15.0),

我想做一个按钮,上面有圆角,底部有正常的角。我怎样才能做到这样

一般示例:

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,
            ),

阅读
BorderRadius
文档添加一些您尝试的代码和所需的屏幕截图..而不是
BorderRadius.all
您可以使用
BorderRadius.only({Radius topLeft:Radius.zer,Radius topleght:Radius.zero,Radius bottomLeft:Radius.zero,Radius bottomRight:Radius.zero})
@Potato OP只需要在顶部设置角点,因此
边界半径。垂直
更容易