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只需要在顶部设置角点,因此边界半径。垂直
更容易