我试图使我的卡透明,以便在后台显示事物。
我曾尝试将卡的颜色属性设置为透明,但是显示的是灰色背景且不透明。
我也尝试使用不透明度不同的白色,但是结果不是透明的纯白色。
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,
如何获得具有透明色的纯白色背景?
答案 0 :(得分:0)
尝试将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"),
),
),
],
),
],
),
),
);
答案 1 :(得分:0)