【发布时间】:2019-04-04 09:25:46
【问题描述】:
我尝试使用不透明的深色背景进行相机预览,并且在中间部分有透明背景的卡片区域。看起来像在深色背景的移动设备中显示对话框,但对话框通过深色背景具有透明背景。
我已经使用列和行小部件完成了,例如:
Column(
children : <Widget>[
Expanded(
child: Container(
color: Colors.Black54
)
),
Row(
children : <Widget>[
Expanded(
child: Container(
color: Colors.Black54
)
),
CardWidget(
width: cardWidth,
height: cardHeight,
Color: Colors.Transparent
),
Expanded(
child: Container(
color: Colors.Black54
)
),
]
),
Expanded(
child: Container(
color: Colors.Black54
)
),
]
)
但我想知道有没有简单的方法,例如:
Container(
color: Colors.Black54,
child: center(
child: CardWidget(
width: cardWidth,
height: cardHeight,
background: Colors.Transparent
)
)
)
请让我知道是否有其他方法可以像上面的代码一样简单。谢谢
【问题讨论】: