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}"),
              ],
        ),
)
原文地址:https://www.cnblogs.com/shellon/p/13529521.html