RenderFlex children have non-zero flex but incoming height constraints are unbounded.


问题

  • Flexible 里用了 Column, 使得高度无法确定

解决方案

  • 将Flexible替换为ConstrainedBox, 并设定maxHeight

代码

ConstrainedBox(
          constraints: BoxConstraints(maxHeight: 500,,
           child: Column(
               mainAxisSize: MainAxisSize.min,
                children: <Widget>[
                Text(object.jobsName, style: TextStyle(fontSize: 20),),
                Text("${object.companyName} | ${object.districtCn}"),
              ],
        ),
)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM