抖动问题:RenderFlex 右侧溢出 248 像素

2024-02-11

我在一列中使用了三个文本,其中一个文本很长,然后我收到此错误“RenderFlex 右侧溢出了 248 像素”。

我在一列中使用了三个文本,其中一个文本字段很长,然后我收到此错误“RenderFlex 右侧溢出了 248 像素”。如何修复它?

enter image description here This is m code.

import 'package:cwc/ApiManager/api_magager.dart';
import 'package:cwc/constants/constants.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:intl/intl.dart';

class EVDetails extends StatefulWidget {
  final eventsListDetails;
  const EVDetails({Key? key, this.eventsListDetails}) : super(key: key);

  @override
  State<EVDetails> createState() => _EVDetailsState();
}

class _EVDetailsState extends State<EVDetails> {

  @override
  Widget build(BuildContext context) {
    return SingleChildScrollView(
      child: Padding(
        padding: const EdgeInsets.fromLTRB(20, 20, 20, 0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Padding(
                  padding: const EdgeInsets.fromLTRB(0, 0, 0, 10),
                  child:widget.eventsListDetails['image'] == null || widget.eventsListDetails['description'] =="" ?Image.asset(
                    'assets/video_cover.png',
                    height: 120,
                    width: 100,
                  ):Image.network(
                    imgBaseUrl+'${widget.eventsListDetails['image']}',
                    height: 120,
                    width: 100,
                    fit: BoxFit.fill,
                  ),
                ),
                Padding(
                  padding: const EdgeInsets.fromLTRB(19, 15, 0, 0),
                  child: Flexible(
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text(
                          '${widget.eventsListDetails['name']}',
                          style: GoogleFonts.poppins(
                            fontSize: 18,
                            color: Color(0xff444444),
                            fontWeight: FontWeight.w600,

                          ),maxLines: 1,
                          overflow: TextOverflow.ellipsis,
                        ),
                        Text(
                          'Cancer, Diabetes and Dental \nProblems',
                          style: GoogleFonts.poppins(
                            fontSize: 12,
                            color: Color(0xff8F9698),
                            fontWeight: FontWeight.normal,
                          ),
                        ),
                        Text(
                          'For Champion Membership',
                          style: GoogleFonts.poppins(
                            fontSize: 14,
                            color: Color(0xffC691D3),
                            fontWeight: FontWeight.w600,
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
               
              ],
            ),
            Text(
              'Event Description',
              style: GoogleFonts.poppins(
                  fontSize: 18,
                  // color: Color(0xFFC691D3),
                  color: Color(0xff444444),
                  fontWeight: FontWeight.w500),
            ),
            SizedBox(
              height: 11,
            ),
            Text(
             "${widget.eventsListDetails['description']}",
              style:
                  GoogleFonts.poppins(fontSize: 13, color: Color(0xFF444444)),
              textAlign: TextAlign.justify,
            ),
            Padding(
              padding: EdgeInsets.fromLTRB(0, 24, 0, 0),
              child: Container(
                decoration: BoxDecoration(
                  color: Color(0xffC691D3).withOpacity(0.2),
                  borderRadius: BorderRadius.only(
                      topRight: Radius.circular(10.0),
                      bottomRight: Radius.circular(10.0),
                      topLeft: Radius.circular(10.0),
                      bottomLeft: Radius.circular(10.0)),
                ),
                child: Padding(
                  padding: const EdgeInsets.all(10.0),
                  child: Row(
                    children: [
                      Column( crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Column(
                            mainAxisAlignment: MainAxisAlignment.start,
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Text(
                                'Start Date & Time',
                                style: GoogleFonts.poppins(
                                  fontSize: 12,
                                  color: Color(0xFF444444),
                                ),
                              ),
                              Text(
                                  "${formateDat(DateTime.parse(widget.eventsListDetails['startTime']))} at ${DateFormat("hh:mm a").format(DateFormat("yyyy-MM-ddTHH:mm:ssZ").parseUTC("${widget.eventsListDetails['startTime']}").toLocal())} PT",
                                style: GoogleFonts.poppins(
                                  fontSize: 14,
                                  color: Color(0xFF444444),
                                ),
                              ),

                            ],
                          ),
                          SizedBox(height: 20,),
                          Column(
                            mainAxisAlignment: MainAxisAlignment.start,
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Text(
                                'End Date & Time',
                                style: GoogleFonts.poppins(
                                  fontSize: 12,
                                  color: Color(0xFF444444),
                                ),
                              ),
                              Text(
                                "${formateDat(DateTime.parse(widget.eventsListDetails['endTime']))} at ${DateFormat("hh:mm a").format(DateFormat("yyyy-MM-ddTHH:mm:ssZ").parseUTC("${widget.eventsListDetails['endTime']}").toLocal())} PT",

                                style: GoogleFonts.poppins(
                                  fontSize: 14,
                                  color: Color(0xFF444444),
                                ),
                              ),
                              Padding(
                                padding: const EdgeInsets.fromLTRB(0, 5, 10, 2),
                                child: Row(
                                  children: [
                                    Row(
                                      children: [
                                        Icon(
                                          Icons.schedule,
                                          color: Color(0xFFC691D3),
                                        ),
                                        SizedBox(
                                          width: 2,
                                        ),
                                        Text(
                                          '${widget.eventsListDetails['duration']} mins',
                                          style: GoogleFonts.poppins(
                                              fontWeight: FontWeight.normal,
                                              fontSize: 14,
                                              color: Color(0xFFC691D3)),
                                        ),
                                      ],
                                    ),
                                    SizedBox(
                                      width: 5,
                                    ),
                                    Row(
                                      children: [
                                        Icon(
                                          Icons.online_prediction,
                                          color: Color(0xFFC691D3),
                                        ),
                                        SizedBox(
                                          width: 2,
                                        ),
                                        Text(
                                          '${widget.eventsListDetails['eventMode']}',
                                          style: GoogleFonts.poppins(
                                              fontWeight: FontWeight.normal,
                                              fontSize: 14,
                                              color: Color(0xFFC691D3)),
                                        ),
                                      ],
                                    ),
                                  ],
                                ),
                              ),
                            ],
                          ),
                        ],
                      ),
                      Spacer(),
                      Image.asset(
                        'assets/calender.png',
                        height: 120,
                        width: 120,
                      )
                    ],
                  ),
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
formateDat(DateTime date) {
  final DateFormat formatter = DateFormat.MMM();
  String formatted = formatter.format(date);
  formatted = "${formatted} " +"${date.day}";
  var week = DateFormat('EEEE').format(date);
  var we = week[0] + week[1] + week[2];
  return "$we, " + formatted;
}

尝试下面的代码希望对您有帮助。将您的列放入展开的小部件中:

 Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Container(
          padding:EdgeInsets.all(5),
          decoration: BoxDecoration(
            color: Colors.orange.shade200,
            border:Border.all(color:Colors.black,),
              borderRadius: BorderRadius.all(
            Radius.circular(12.0),
          ),),
          child: Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              Image.network(
                'https://miro.medium.com/max/1400/1*-6WdIcd88w3pfphHOYln3Q.png',
                width: 100,
              ),
              SizedBox(
                width: 10,
              ),
              Expanded(
                child: Column(//put this column inside Expanded widget
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      ' {widget.eventsListDetails[index][ name ]}',
                    ),
                    Text('Cancer,Diabetes and Dental Problems'),
                    Text(
                      " {widget.eventsListDetails[index]['description']}ex]['description']}",
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
        SizedBox(height: 10),
        Text('Event Description'),
        SizedBox(height: 10),
        Text(
            'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.'),
      ],
    ),

Your result screen-> enter image description here

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

抖动问题:RenderFlex 右侧溢出 248 像素 的相关文章

随机推荐

  • 将所有数字字符串递归转换为 Ruby 哈希中的整数

    我有一个随机大小的哈希值 其值可能如下 100 我想将其转换为整数 我知道我可以使用value to i if value to i to s value 但考虑到值可以是字符串 数组 散列或字符串 或另一个散列 我不确定如何在散列中递归地
  • 将文件移动到另一个目录的批处理文件

    我希望你能帮我解决这个问题 它可能已经被问过多次 我知道 但由于某种原因 我就是无法让它工作 我想将一些文件从 files 目录移动到根目录 例如 这些文件是 test1 txt test2 txt test3 zip test4 zip
  • JAXB 删除 XmlRootElement 包装器

    我有这个 XmlRootElement 类 Person XmlRootElement class Person private String desc 返回内容为 Person desc abc 我真的不想要根包装器 所以我希望内容看起来
  • 从远程计算机访问 TEAMCITY

    我在从远程计算机浏览我的团队城市 JetBrains 时遇到问题 我已按照安装说明进行操作 安装很顺利 我可以在服务器上本地浏览应用程序 没有任何问题 我将配置文件中的默认服务器 URL 更改为http 我的 http my服务器名称 我可
  • MatDatepickerFilter - 过滤器函数无法访问类变量

    一个 MatDatePicker 其过滤器定义如下
  • Clang 项目的 AST

    我使用 Clang python 绑定来提取 c c 文件的 AST 它非常适合我编写的一个简单程序 问题是当我想将它用于像 openssl 这样的大项目时 我可以为项目的任何单个文件运行 clang 但 clang 似乎错过了项目的一些标
  • 为什么 ARM mac 上的 hello world 汇编“无效”?

    其他答案没有告诉我如何编译 我被困住了 我在汇编中有一个简单的 hello world global start align 2 start mov X0 1 adr X1 hello mov X2 13 mov X16 4 svc 0 m
  • 什么时候禁用视图状态是安全的?

    什么时候禁用视图状态是安全的 用于哪些控件 什么情况下 在用户控件中 我禁用了视图状态 但是如果我尝试单击此控件
  • 无法在 PHPMyAdmin 中选择 Latin-1 作为字符集

    我正在尝试按照教程进行操作 在教程中 讲师演示了如何编辑config inc文件将文件夹设置为 UploadDir 这使他能够选择 SQL在 phpmyadmin 中导入时 从 Web 服务器上传目录 下拉菜单中导入该文件夹中的文件 我尝试
  • Spring Data JPA 太慢

    我最近将我的应用程序切换到 Spring Boot 2 我依靠 Spring Data JPA 来处理所有事务 我注意到这与我的旧配置之间存在巨大的速度差异 存储大约 1000 个元素在大约 6 秒内完成 现在需要超过 25 秒 我看过有关
  • Powershell - 使用“拍摄日期”属性重命名文件

    我的三星手机上有一堆图像和视频 我将这些图像复制到 USB 然后复制到我的电脑上 我想使用 Powershell 根据这些文件的 拍摄日期 属性重命名这些文件 格式要求 yyyy MM dd HH mm ss ddd 我一直在使用 Powe
  • Paypal Checkout - 不询问非会员的送货地址吗?

    我刚刚开始使用这个模块 https github com paypal paypal checkout https github com paypal paypal checkout 我正在尝试找出如何关闭客户的送货地址 我知道你可以做的订
  • Rails 如何在未找到记录时重定向

    如果找不到记录 我正在尝试重定向 该页面未重定向 并且出现未找到错误记录 我的控制器 def index link Link find params id respond to do format if link blank format
  • 自动上传新创建的文件到SFTP服务器

    ASP NET 应用程序 在 Windows 服务器 IIS 7 上运行 必须将当前用户上传的大文件传输到外部 SFTP 服务器 由于文件大小 我们的想法是异步执行此操作 这个想法是 ASP NET 应用程序将上传的文件存储在 Window
  • 如何从 Gtk ScrolledWindow 中删除框架(或边框?)

    如何删除 Gtk ScrolledWindow gtk 的框架 或边框 如果是 用于window ShadowType ShadowType None 不工作 window BorderWidth 0 不工作 感谢帮助 Set the Fo
  • 是否可以将 .coffee 脚本文件加载到浏览器并执行?

    我正在尝试将咖啡脚本与 Coffee script js 文件一起加载到 Sample coffee 文件中 并对 HTML 执行一些简单的操作 但我无法加载sample coffee 文件
  • 如何在Python中使用ftplib上传二进制文件?

    我的 python2 脚本使用这种方法很好地上传文件 但 python3 出现了问题 我不知道下一步该去哪里 谷歌搜索没有帮助 from ftplib import FTP ftp FTP ftp host ftp user ftp pas
  • Tableau Javascript API HTTPS 不起作用

    我正在尝试将报告嵌入到我的网站上 但出现以下错误 混合内容 页面位于 https mywebsite com blah blah https mywebsite com blah blah 通过 HTTPS 加载 但请求了不安全的资源 ht
  • python 3.3 和 3.3m 有什么区别[重复]

    这个问题在这里已经有答案了 python 3 3 和 3 3m 有什么区别 我正在使用 Ubuntu 13 04 Raring 在我的系统上我有 python2 7 和 python3 3 我知道 2 和 3 之间的区别 但我还安装了 py
  • 抖动问题:RenderFlex 右侧溢出 248 像素

    我在一列中使用了三个文本 其中一个文本很长 然后我收到此错误 RenderFlex 右侧溢出了 248 像素 我在一列中使用了三个文本 其中一个文本字段很长 然后我收到此错误 RenderFlex 右侧溢出了 248 像素 如何修复它 Th