【发布时间】:2021-09-13 11:41:26
【问题描述】:
我想实现这个:
但我最终得到了这个(忽略颜色):
如何塑造彩色边框边的边框,我一直收到这个奇怪的错误(或者至少我从来没有遇到过),我塑造了 topLeft 和 bottomLeft 边框并弹出A borderRadius can only be given for a uniform Border.我在做什么这里错了吗?我在Card 小部件中放置了一个Container,我尝试了相反的方法,但不是我预期的结果。我现在有了我需要的东西,我只需要围绕容器的左上角和左下角(或者其他东西)来实现第一张蓝色图片的目标。
代码如下:
Container(
height: 98.0,
width: double.infinity,
child: Card(
elevation: 4,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.0),
),
shadowColor: Color.fromRGBO(0, 0, 0, 0.6),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), //this is causing the error, when I remove it, I get the card like on picture 2 with the red line
border: Border(
left: BorderSide(
color: Colors.red,
width: 3.0,
style: BorderStyle.solid),
),
),
child: Row(
// some content here
],
),
),
),
),
提前感谢您的帮助!
【问题讨论】:
标签: flutter mobile flutter-layout