gpt4 book ai didi

colors - 透明背景的 Flutter 卡片

转载 作者:IT王子 更新时间:2023-10-29 07:21:01 24 4
gpt4 key购买 nike

我试图让我的卡片透明以便在背景中显示。

我曾尝试将卡片的颜色属性设置为透明,但它显示的是不透明的灰色背景。

Result

我也尝试使用不同不透明度的白色,但结果不是透明的纯白色。

   Card(
color: Colors.transparent,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
CardLabelSmall("Current Premix Plan Document"),
Expanded(child: PremixPlanDocList()),
Row(
children: <Widget>[
Expanded(
child: RaisedButton(
onPressed: () async {
homeBloc.retrieveCurrentMrfPremixPlan();
},
child: const Text("Retrieve Premix Plan"),
),
),
],
),
],
),
),
);

其他白色但仍然不是白色

color: Colors.white70,
color: Colors.white54,
color: Colors.white30,

如何实现透光的纯白背景?

最佳答案

尝试将 elevation 设置为 0,它应该可以工作

Card(
elevation: 0,
color: Colors.transparent,
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
CardLabelSmall("Current Premix Plan Document"),
Expanded(child: PremixPlanDocList()),
Row(
children: <Widget>[
Expanded(
child: RaisedButton(
onPressed: () async {
homeBloc.retrieveCurrentMrfPremixPlan();
},
child: const Text("Retrieve Premix Plan"),
),
),
],
),
],
),
),
);

关于colors - 透明背景的 Flutter 卡片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55645410/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com