颤振扩展图块删除尾随

2024-03-25

我有一个 exoansiontile,我希望它像一个盒子,一切都居中,问题是,如果我添加太长的文本,我会收到溢出错误,我认为这是由扩展图块的尾随引起的。这是一张图片:https://gyazo.com/c29329106dc5dcb162b71b5f41951b67 https://gyazo.com/c29329106dc5dcb162b71b5f41951b67

这是代码:

ExpansionTile(

    trailing: Text(''),
    leading: Container(
        margin: new EdgeInsets.only(left: 0, top: 10.0, right: 0.0, bottom: 0.0),
        child: Image.asset(
            'images/food.png'
        )),
    title: Row(
        children: < Widget > [


            Padding(
                padding: const EdgeInsets.only(right: 0, left: 10, top: 15, bottom: 15),
                    child: Column(textDirection: TextDirection.ltr, crossAxisAlignment: CrossAxisAlignment.start, children: < Widget > [



                        Container(
                            margin: new EdgeInsets.only(left: 0.0, top: 7.0, right: 0.0, bottom: 3.0),
                            child: Text(
                                'Food System', textAlign: TextAlign.left,
                                style: TextStyle(
                                    color: Colors.white,
                                    fontSize: 25,
                                ),
                            )),
                        Text(
                            'Customize the food system', textAlign: TextAlign.left,
                            style: TextStyle(

                                color: Colors.white,
                                fontSize: 15,
                            ),
                        )

                    ])),

        ], ),
    children: < Widget > [



        Container(
            width: 300,
            margin: new EdgeInsets.only(left: 10.0, top: 0.0, right: 10.0, bottom: 10.0),
            color: Colors.transparent,
            child: new Container(


                padding: new EdgeInsets.all(20),
                child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: < Widget > [
                    Container(
                        margin: new EdgeInsets.only(left: 15.0, top: .0, right: 20.0, bottom: 5.0),
                        child: Text('Storage', style: TextStyle(color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold)), ),
                    Center(child: Column(children: < Widget > [
                        Container(
                            child: Column(children: < Widget > [
                                Text('2.4 KG left        -        7 Days', style: TextStyle(color: Colors.white, fontSize: 20)),
                                Text('200 G / Meal  - 600 G / Day', style: TextStyle(color: Colors.white, fontSize: 20)),
                            ], ),
                            margin: new EdgeInsets.only(left: 0, top: 0, right: 0, bottom: 10.0),
                        )

                    ], )),
                    Container(
                        margin: new EdgeInsets.only(left: 18.0, top: .0, right: 20.0, bottom: 5.0),
                        child: Text('Meal times', style: TextStyle(color: Colors.white, fontSize: 20, fontWeight: FontWeight.bold)), ),
                    Center(child: Column(children: < Widget > [

                        Text('1.   Breakfast   -   8:30 AM', style: TextStyle(color: Colors.white, fontSize: 20)),
                        Text('2.   Lunch         -   2:00 PM', style: TextStyle(color: Colors.white, fontSize: 20)),
                        Text('3.   Dinner        -   9:15  PM', style: TextStyle(color: Colors.white, fontSize: 20)),
                    ], ))
                ], ), )
        ),




        Container(
            height: 50.0,
            width: 300,

            margin: new EdgeInsets.only(left: 10.0, top: 10.0, right: 10.0, bottom: 10.0),
            color: Colors.transparent,
            child: new Container(
                decoration: new BoxDecoration(
                    color: Colors.blue,
                    gradient: LinearGradient(
                        begin: Alignment.topRight,
                        end: Alignment.bottomLeft,
                        colors: [Color(0xff37b9ff), Color(0xff5d3afd)]),
                    borderRadius: new BorderRadius.only(
                        topLeft: const Radius.circular(40.0),
                            topRight: const Radius.circular(40.0),
                                bottomLeft: const Radius.circular(40.0),
                                    bottomRight: const Radius.circular(40.0),

                    )
                ),
                child: Center(child:

                    Text('Edit', style: TextStyle(color: Colors.white, fontSize: 15))

                    , )
            )
        ),
    ]

Update

just add

trailing: const SizedBox(),

如果您想对每个 matrail 类进行完全自定义,您可以采用第二种方式这个答案 https://stackoverflow.com/a/64124471/6813907

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

颤振扩展图块删除尾随 的相关文章

随机推荐

  • 在 Windows 10 中找不到模块“internal/util/types”

    我刚刚尝试了很多解决方案来解决此问题 当我执行 npm install 时 我得到 Cannot find module internal util types 我尝试了以下基于 StackOverflow 和 Git 的解决方案 1 从
  • 检查字符串是否为实数[重复]

    这个问题在这里已经有答案了 有没有一种快速的方法来查找字符串是否是实数 而不是一次读取一个字符并执行isdigit 在每个角色上 例如 我希望能够测试浮点数0 03001 如果您将浮点数表示为实数 则这应该有效 def isfloat st
  • Objective-C 中的宏调用 isEqualToString:产生有关无效令牌的错误

    我正在尝试定义一个这样的宏 define SOME DEF TTys getString isEqualToString ANOTHER STRING 然后执行以下操作 if SOME DEF endif TTys getString 返回
  • 通过引用 Cython 传递单个整数?

    我正在尝试让一个测试项目正常运行 该项目调用一个 C 函数 其中有一个需要通过引用传递的整数参数 来自 Python test cpp include
  • 如何将用户输入输入 PackageMaker 包中?

    我正在尝试创建一个安装包 我已经掌握了所有组件 并且我想我了解了大部分过程 我想要一个作为安装一部分运行的安装 设置脚本 我计划将其作为安装后操作或安装后脚本 问题是我需要用户输入 我不知道如何将用户输入添加到脚本中 或者如何在安装 UI
  • 需要刷新页面内容

    我正在使用 codeigniter 框架 目前正在从事社交网络之类的工作 我的问题是 当用户单击提要链接时 我需要通知用户他们的朋友活动 而无需重新加载页面 我尝试过以下脚本 它增加了我的服务器的负载 完成此任务的任何其他想法 提前致谢 然
  • 描述编译时已知的“consteval”函数参数的名称,但 constexpr 不知道

    论证consteval函数是 sort of 编译时已知 but is not 常量表达式 安德鲁 萨顿 Andrew Sutton 在他的论文中解释了这种行为背后的动机翻译和评估 编译时元编程的思维模型 http www open std
  • 下载/缓存 Google 地图以供离线使用[关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 我希望能够在 Android 应用程序中实现这一点 并且我认为最新的 Google Maps API 版本可以实现这一点 但我还没有看到关
  • 在简单的 http get 示例中找不到模块“Network.HTTP”

    我正在尝试这个简单的例子 module Main where import Network HTTP import Lib get String gt IO String get url simpleHTTP getRequest url
  • WPF dataGrid查找单个单元格的X和Y并设置背景颜色

    我有一个绑定到数据网格 MVVM 的类型化数据集 我还有一个点列表 输入数据集中的 X 和 Y 表明哪些单元格有错误 检测这一点的逻辑很复杂并且在服务器端运行 我的目标是如果每个单元格有错误 则将其背景绘制为不同的颜色 即点列表包含该单元格
  • Mockk 模拟 Kotlin 中的私有属性

    我有一个带有私有字段的简单类 class EmployeeData private var employeeAge Int 0 fun getAge Int return 1 employeeAge 我正在尝试测试这个私有的employee
  • 下载电子邮件附件时使用 C# 中的 Microsoft Security Essentials

    我正在制作一个简单的程序 使用 VS2010 从 pop3 服务器获取电子邮件 可能会使用开源 OpenPOP 来完成其中的一些工作 然后它应该将电子邮件和附件保存在 MS SQL 数据库中 但问题是 虽然附件很容易从邮件服务器下载 但有没
  • 在 Flutter 桌面应用程序/插件中调试本机 C++ 代码

    我正在为 Flutter 桌面应用程序 Linux 和 Windows 创建本机插件实现 并且我想调试插件的 C 实现 我只找到了如何使用 ios android 平台代码执行此操作的指南 https flutter dev docs te
  • 如何让Jupyter Notebook在GPU上运行?

    在 Google Collab 中 您可以选择笔记本在 CPU 或 GPU 环境上运行 现在我有一台配备 NVDIA Cuda 兼容 GPU 1050 和最新 anaconda 的笔记本电脑 如何拥有与协作功能类似的功能 让我可以简单地让我
  • 如何获得N个总和等于M的随机整数

    我想制作一个由 N 个随机整数组成的列表 其总和等于 M 个数字 我在Python中使用了numpy和dirichlet函数 但是这会生成双随机数数组 我想生成整数随机数 import numpy as np np random diric
  • 如何最好地使用 php 和 mysql 从分数表中获取某人的“排名”而不循环

    我的桌子上有乐谱和缩写 但桌子不会被订购 我可以很容易地获得总行数 并且我知道我可以获取所有行数和排序依据 然后循环遍历它们并以这种方式获得排名 但还有更好的办法吗 这可以通过 SQL 语句来完成吗 我不太关心性能 所以如果 SQL 语句是
  • 广告的 HTML 元素?

    网络上是否有关于为广告横幅选择哪种 HTML 元素的权威信息 我考虑过
  • 该浏览器无法识别 React Three Fiber 网格标签

    我正在关注 Youtube 上的 3d 作品集教程 但遇到了这个错误 在这里 我尝试渲染网格 但控制台显示警告 此元素在此浏览器中无法识别 浏览器正在渲染其余部分 但这部分代码没有被渲染 这是代码块 const Computers gt c
  • 如何在 C# 中模拟没有接口和虚方法的类?

    我正在为别人的代码编写单元测试 但我不允许修改这些代码 假设我有 class BadClass public BadClass the service isn t going to be running during testing it
  • 颤振扩展图块删除尾随

    我有一个 exoansiontile 我希望它像一个盒子 一切都居中 问题是 如果我添加太长的文本 我会收到溢出错误 我认为这是由扩展图块的尾随引起的 这是一张图片 https gyazo com c29329106dc5dcb162b71