SliverGeometry is not valid: The "scrollExtent" is negative.
The relevant error-causing widget was
ListView
lib/OnlyCallUI/CallCategoryUI.dart:47
The following RenderObject was being processed when the exception was fired: RenderSliverList#fa84c relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
RenderObject: RenderSliverList#fa84c relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
needs compositing
parentData: paintOffset=Offset(0.0, 0.0) (can use size)
constraints: SliverConstraints(AxisDirection.down, GrowthDirection.forward, ScrollDirection.idle, scrollOffset: 0.0, remainingPaintExtent: 95.8, crossAxisExtent: 375.0, crossAxisDirection: AxisDirection.right, viewportMainAxisExtent: 95.8, remainingCacheExtent: 345.8 cacheOrigin: 0.0 )
geometry: SliverGeometry(scrollExtent: -0.0, hidden, maxPaintExtent: -0.0)
scrollExtent: -0.0
hidden
maxPaintExtent: -0.0
currently live children: 9 to 9
child with index 9: RenderIndexedSemantics#e1039 relayoutBoundary=up3
needs compositing
parentData: index=9; layoutOffset=-0.0 (can use size)
constraints: BoxConstraints(w=375.0, 0.0<=h<=Infinity)
semantic boundary
size: Size(375.0, 0.0)
index: 9
child: RenderRepaintBoundary#a760a relayoutBoundary=up4
needs compositing
parentData: <none> (can use size)
constraints: BoxConstraints(w=375.0, 0.0<=h<=Infinity)
layer: OffsetLayer#283e1 DETACHED
offset: Offset(0.0, 101.5)
size: Size(375.0, 0.0)
metrics: 96.7% useful (1 bad vs 29 good)
diagnosis: this is an outstandingly useful repaint boundary and should definitely be kept
child: RenderConstrainedBox#db1c5 relayoutBoundary=up5
parentData: <none> (can use size)
constraints: BoxConstraints(w=375.0, 0.0<=h<=Infinity)
size: Size(375.0, 0.0)
вот что я получаю сообщение об ошибке
Container(
child: ListView.builder(
padding: EdgeInsets.all(0),
//shrinkWrap: true,
itemCount: dataList.length,
itemBuilder: (context, index) {
print(index);
String name, addr1, addr2, category, id;
int phone;
double lat1, lng1;
bool menuTF;
DocumentSnapshot marketData = dataList[index];
try {
name = marketData['name'];
addr1 = marketData['addr1'];
addr2 = marketData['addr2'];
phone = marketData['phone'];
category = marketData['category'];
id = marketData.documentID;
lat1 = marketData['position']['geopoint'].latitude;
lng1 = marketData['position']['geopoint'].longitude;
menuTF = marketData['menu'];
} catch (_) {
phone = 0;
}
if (dataSet.isSelect()) {
if (category != dataSet.getSelectedCategory()) {
return SizedBox(
height: 0,
width: 0,
);
}
}
return Slidable(
actionPane: SlidableDrawerActionPane(),
actionExtentRatio: 0.25,
child: Container(
child: Column(~~~~~)
);
},
),
);
}
Я не могу понять, почему эта ошибка не возникает сразу. в середине кода вы можете увидеть dataSet.isSelect()
У меня есть список, в котором есть категория для каждого из данных, поэтому, когда я выбираю конкретную категорию c, этот виджет показывает, что только у нескольких данных есть категория, выбранная пользователем, но для нескольких первый раз это работает, а после (я не знаю, в чем причина ошибки) эта ошибка возникает