Flutter 如何在颤振中创建透明容器

Flutter 如何在颤振中创建透明容器,flutter,dart,flutter-layout,flutter-web,Flutter,Dart,Flutter Layout,Flutter Web,我希望使容器透明,如下所示: 以下是容器代码: : Container(child: Column( children: [ Container(child: Text('Address: '), alignment: Alignment.centerLeft,), Divider(color: Colors.grey,), Container(child: Text('$address'), alignmen

我希望使容器透明,如下所示:

以下是容器代码:

: Container(child: Column(
    children: [
             Container(child: Text('Address: '), alignment: Alignment.centerLeft,),
             Divider(color: Colors.grey,),
             Container(child: Text('$address'), alignment: Alignment.centerLeft,),
             ],
            ),
   color: Color(0xFF005D6C),
   );
如果我给出color:color(0xFF005D6C)。使用不透明度(0.5)那么,它只是使颜色像这样变亮


如何使容器透明?

尝试将其包装在“不透明度”小部件中

Opacity(
  opacity: 0.5,
  child: Container(child: Column(
    children: [
             Container(child: Text('Address: '), alignment: Alignment.centerLeft,),
             Divider(color: Colors.grey,),
             Container(child: Text('$address'), alignment: Alignment.centerLeft,),
             ],
            ),
   color: Color(0xFF005D),
   ),
)

尝试使用
颜色。透明
+
不透明度
用于
容器

容器(
颜色:颜色。透明。不透明度(0.5),
子:列(
儿童:[
容器(
子项:文本('地址:'),
对齐:alignment.centerLeft,
),
分隔器(
颜色:颜色。灰色,
),
容器(
子项:文本(“$address”),
对齐:alignment.centerLeft,
),
],
),

现在容器的背景色不出现了。背景中是否有某种图像?因为如果下面只有白色背景,则颜色会显得更亮。我没有任何背景图像。因此,这可能是问题所在……尝试在背景中添加一些内容,如果您的容器得到透明我给了背景白色,所以,如果我给容器一些不透明的绿色,它应该使容器透明