我在Expanded小部件内使用ListView.Builder,但这是通过异常
RenderFlex children have non-zero flex but incoming height constraints are unbounded.
RenderBox was not laid out: RenderRepaintBoundary#508c1 NEEDS-LAYOUT NEEDS-PAINT
'package:flutter/src/rendering/box.dart':
Failed assertion: line 1696 pos 12: 'hasSize'
名为LogTimeline
的ListView.builder小部件
Widget build(BuildContext context) {
return Expanded(
child: ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: timelineList.length,
itemBuilder: (context, index) {
return Container(
child: Row(
children: [
Column(
children: [
Container(),
Container(),
Container(),
],),
],),
),}
),),}
LogTimeline
使用的小部件
Wrap(
children: [
LogHeader(
headerTitle: "Overtime log",
),
LogTimeline(
timelineList: overtimeList,
),
],
)
在包装小部件中使用ListView.builder时,它显示“底部溢出” 我该如何解决此异常,为什么会发生此异常,
答案 0 :(得分:0)
尝试删除扩展小部件,然后查看