Flutter 卡的颤振边界半径不';t申请儿童:集装箱?
我有下面的代码,我想知道如何使容器接受卡?我知道的唯一方法是在容器的盒子装饰中添加BorderRadius,但这是正确的方法吗?我怎样才能做得更好Flutter 卡的颤振边界半径不';t申请儿童:集装箱?,flutter,flutter-layout,Flutter,Flutter Layout,我有下面的代码,我想知道如何使容器接受卡?我知道的唯一方法是在容器的盒子装饰中添加BorderRadius,但这是正确的方法吗?我怎样才能做得更好 Align( child: Card( elevation: 10, shape: RoundedRectangleBorder( borderRadius: BorderRadi
Align(
child: Card(
elevation: 10,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
child: Container(
width: 200,
height: 200,
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Color(0xff232526),Color(0xff414345) ],
begin: Alignment.bottomCenter,
// stops: [0.1,1],
end: Alignment.topCenter,
),
),
child: RadialGauge(
counter: snapshot.data['Strom'].toDouble(),
).buildGauge(),
),
),
),
在您的集装箱箱中,添加以下内容
边界半径:边界半径。圆形(半径),
在您的包装箱中,将此添加到容器的包装箱中
边界半径:边界半径。圆形(半径),
您可以使用Clip.hardEdge,将多余的部分剪掉
Card(
clipBehavior: Clip.hardEdge,
elevation: 10,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
child:...
您可以使用Clip.hardEdge,将多余的部分剪掉
Card(
clipBehavior: Clip.hardEdge,
elevation: 10,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
child:...
这样做完全可以。不要使用剪辑,因为这被认为是一个繁重的操作。这样做很好。不要使用剪辑,因为这被认为是一个繁重的操作。