flutter报错:NoSuchMethodError: The method '>' was called on null.

写了个list,发现出不来,报错

flutter: Another exception was thrown: RenderBox was not laid out: _RenderScrollSemantics#81b3a relayoutBoundary=up3 NEEDS-PAINT
flutter: Another exception was thrown: 'package:flutter/src/rendering/shifted_box.dart': Failed assertion: line 314 pos 12: 'child.hasSize': is not true.
flutter: Another exception was thrown: NoSuchMethodError: The method '<=' was called on null.
flutter: Another exception was thrown: NoSuchMethodError: The getter 'visible' was called on null.

搜了搜发现是Column或Row里面要加个Flexible来包裹里面的内容: https://github.com/flutter/flutter/issues/21628

复制代码
Column(
children:
<Widget>[ Flexible( child: ListView( children: <Widget>[ ListTitle(leading:Icon(Icons.code),title:Text('hahaha')) ], ), ) ], )
复制代码

解决了,但不知道具体是为何🤦‍♀️

 

posted @   c-137Summer  阅读(4815)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
点击右上角即可分享
微信分享提示