【发布时间】:2022-01-03 20:04:43
【问题描述】:
这是我当前的小部件:
我希望边框看起来是透明的,这样我就可以看到它后面的红色背景。我试过用Container 包装它,颜色为Colors.transparent,但它根本没有用。
我怎样才能做到这一点?这是我的代码,目前:
return Container(
height: 80.0,
decoration: const BoxDecoration(
color: Colors.black38,
borderRadius: BorderRadius.all(
Radius.circular(15),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
const SizedBox(width: 11.0),
Container(
decoration: BoxDecoration(
color: addiction.color,
borderRadius: const BorderRadius.all(
Radius.circular(15),
),
),
height: 60.0,
width: 6.0,
),
const SizedBox(width: 11.0),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
addiction.name,
style: GoogleFonts.lato(
fontSize: 21.0,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 4.0),
buildDate(),
],
),
],
),
],
),
);
有什么想法吗?
【问题讨论】: