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