如何在颤动中创建透明容器 [英] How to create a transparent container in flutter

查看:0
本文介绍了如何在颤动中创建透明容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

这是集装箱编码:

: 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).with Opacity(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),
   ),
)

这篇关于如何在颤动中创建透明容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆