使容器背景透明?

2024-01-03

I have a container which look like this enter image description here

它有一些背景颜色。我希望容器后面的列表应该可见。为容器编写的代码如下:

 new Container(
                  margin: EdgeInsets.fromLTRB(50.0, 10.0, 50.0, 10.0),
                  width: _isTextFieldActive ? 150.0 : 80.0,
                  height: 40.0,
                  decoration: new BoxDecoration(
                      color: Color(0xFF98DAFC),
                      borderRadius: new BorderRadius.only(
                          topLeft: Radius.circular(0.0),
                          topRight: Radius.circular(32.0),
                          bottomLeft: Radius.circular(0.0),
                          bottomRight: Radius.circular(32.0))),
                  alignment: Alignment.bottomCenter,
                  child: new Row(
                    children: <Widget>[
                      new Container(
                          width: 40.0,
                          height: 40.0,
                          child: new Checkbox(value: true)),
                      new Container(
                              width: 40.0,
                              height: 40.0,
                              decoration: new BoxDecoration(
                                  color: Color(0xFFDEDEDE),
                                  borderRadius:
                                      new BorderRadius.circular(32.0)),
                              child: new IconButton(
                                icon: Icon(Icons.search),
                               );
                                  }
                                },
                              ))
                    ],
                  ),
                ),

所以,我想要没有背景颜色的容器,并且容器后面的列表应该可见

if i remove the above code i am getting the screen as below. enter image description here


我不能 100% 确定这是否属实,因为我现在无法测试它,但我认为问题可能出在 margin 属性上。如果我理解正确的话,您希望容器位于底部中心,底部填充为 10dp。我会这样做:

Align(
  alignment: Alignment.bottomCenter,
  child: Padding(
    padding: const EdgeInsets.only(bottom: 10.0),
    child: Container(
      height: 40.0,
      decoration: BoxDecoration(
        color: Color(0xFF98DAFC),
        borderRadius: const BorderRadius.only(
          topLeft: Radius.circular(0.0),
          topRight: Radius.circular(32.0),
          bottomLeft: Radius.circular(0.0),
          bottomRight: Radius.circular(32.0),
        ),
      ),
      child: ...,
    ),
  ),
)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使容器背景透明? 的相关文章

随机推荐

  • TabItem 绑定 WPF

    我刚刚学习 WPF 我需要一些帮助 我有一个使用 TabControl 并动态生成新选项卡的应用程序 在每个选项卡上我有一个 TextBox 现在我想向工具栏添加一个撤消按钮 该工具栏不是选项卡的一部分 类似 VisualStudio 撤消
  • 在 Groovy 中将地图与递归嵌套地图合并

    我想知道是否有人有一种简单的方法将 2 个深层嵌套地图合并在一起 例如 我想得到 a 1 animals cat blue b 2 animals dog red a 1 b 2 animals cat blue dog red 有人有简单
  • 合并重叠的数字范围

    我需要将重叠的数字范围合并为单个范围 所以我有一个包含子列表的列表 例如 83 77 103 97 82 76 101 95 78 72 97 91 72 66 89 83 63 57 78 72 53 47 65 59 41 35 50
  • Cipher 是线程安全的吗?

    很简单 一个实例可以javax crypto Cipher e g Cipher getInstance RSA 可以从多个线程中使用 或者我是否需要将多个线程粘在一个线程中ThreadLocal 就我而言 不 不是 该实例是有状态的 因此
  • 用于二维数组的 ASP.NET MVC 5 编辑器

    我有一个包含二维数组的模型 public class Matrix public ValidInt Data Range 0 8 ErrorMessage public int Width get set Range 0 8 ErrorMe
  • 宏操作符列表

    我知道宏的字符串化运算符 并且我最近了解到 连接运算符 带有字符串文字前缀的预处理器字符串化运算符 https stackoverflow com questions 29850088 preprocessor stringizing op
  • 我可以在垫子扩展行内显示另一个表格吗?

    我有一张带扩展行的垫子桌 如果我单击一行 它会展开并显示硬编码字符串 我想在展开的行内显示另一个表格 是否可以 或者 是否有任何其他技术或方法来实现我想要做的事情 我正在尝试显示给定时间段内已执行作业的列表 在主行上 我只想显示类似 01
  • 在 Spring Boot 中的 application.properties 中使用 Maven 属性

    我正在尝试将 pom xml 中的属性加载到 application properties 中 我想创建两个配置文件 dev 和 prod 以使用不同的数据库 url 我使用 Jenkins 作为 CI 在我的所有应用程序 主要是 Spri
  • 获取直线与多边形相交点的坐标

    我想找到一条线与多边形相交的点 我使用凹轮廓计算获得了这个多边形thread https stackoverflow com questions 57260352 python concave hull polygon of a set o
  • 在 C# 中使用 BitmapData 和指针快速修改位图

    我正在从某些相机捕获数据 原始数据数组 然后我根据调色板将此数据映射到 RGB 值 我需要尽快绘制它 所以我使用BitmapDdata并使用指针编辑不安全代码段中的像素 public void dataAcquired int data B
  • glob 函数中的正则表达式模式

    我在函数中收到了一个文件名 我想从其他目录返回与此文件 按文件名 类似的所有文件 我写了这个 thumbDir this gt files path thumbs toglob thumbDir pathinfo name PATHINFO
  • 用于在 inno 设置安装程序中显示多行内容的控件

    I want to show the content like in below image in installation step of installer i have used memo for showing the conten
  • 高斯过程 scikit-learn - 异常

    我想使用高斯过程来解决回归任务 我的数据如下 每个X向量的长度为37 每个Y向量的长度为8 我正在使用sklearn封装在Python但尝试使用高斯过程会导致Exception from sklearn import gaussian pr
  • 此 SelectClauseVisitor 不支持表达式类型“NhSumExpression”

    我有一个可以在 LinqPad 中运行的查询 但不能在 NHibernate LINQ 中运行 我在 NHibernate Jira 上发现了类似的错误NHibernate NH 2865 https nhibernate jira com
  • 在translatey css动画之后出现了一些空白

    我有一个像这样的侧面构建
  • VSTS 将 docker-compose 推送到 Azure 容器注册表和 WebApp

    我想配置从 VSTS 到 Azure 容器注册表 然后到 WebApp 的持续集成 这是我的docker compose yml文件 正如你所看到的 我使用的是 Asp Net core mssql 版本 3 services api im
  • 如何在Qt中的sqlite内存数据库和文件数据库之间备份/存储?

    备份 恢复最简单的方法是什么sqlite内存数据库到文件数据库Qt 我认为您需要直接使用 SQLite 来完成此操作 SQLite 有一个在线备份API http www sqlite org backup html 第一个示例是将内存数据
  • raphaeljs 的移动 Safari SVG 渲染问题

    我正在使用动画交互式图表raphael http raphaeljs com 我需要在 iPhone 上顺利工作 我有两个正在努力解决的小渲染问题 第一个是 每当您单击附加了单击处理程序的 svg 元素时 mobile safari 都会在
  • 用作 库中 find_if 中谓词的函数要求是什么?

    我无法判断我是否在这里遗漏了一些明显的东西 但我似乎无法让 find if 工作 include
  • 使容器背景透明?

    I have a container which look like this 它有一些背景颜色 我希望容器后面的列表应该可见 为容器编写的代码如下 new Container margin EdgeInsets fromLTRB 50 0