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}"),
              ],
        ),
)
posted @ 2020-08-19 15:13  shellon  阅读(3838)  评论(0编辑  收藏  举报