[Flutter Error]The following RangeError was thrown building KeyedSubtree-[<0>]: RangeE
2021-03-01 12:25
标签:art ror 解决方法 erro new sub err container view 运行时还没获取到数据,就执行了 类似这样的数据输出, 添加 this._newsDataList.length > 0 标签:art ror 解决方法 erro new sub err container view 原文地址:https://www.cnblogs.com/TobuTobu/p/14350918.html错误:
The following RangeError was thrown building KeyedSubtree-[]:
RangeError (index): Invalid value: Valid value range is empty: 0
原因:
child: Text(‘${this._newsDataList[index].title}‘解决方法:对数据是否获取到进行判断。
return this._newsDataList.length > 0
? ListView.builder(
...
)
: Container(
margin: EdgeInsets.all(ScreenAdapter.setHeight(20)),
height: ScreenAdapter.setHeight(800),
);
下一篇:AcWing 201. 可见的点
文章标题:[Flutter Error]The following RangeError was thrown building KeyedSubtree-[<0>]: RangeE
文章链接:http://soscw.com/index.php/essay/58544.html