parent
0e22aca785
commit
ff22813b77
@ -1257,26 +1257,17 @@ class ListView extends BoxScrollView {
|
||||
childrenDelegate = SliverChildBuilderDelegate(
|
||||
(BuildContext context, int index) {
|
||||
final int itemIndex = index ~/ 2;
|
||||
final Widget? widget;
|
||||
if (index.isEven) {
|
||||
widget = itemBuilder(context, itemIndex);
|
||||
} else {
|
||||
widget = separatorBuilder(context, itemIndex);
|
||||
assert(() {
|
||||
if (widget == null) {
|
||||
throw FlutterError('separatorBuilder cannot return null.');
|
||||
return itemBuilder(context, itemIndex);
|
||||
}
|
||||
return true;
|
||||
}());
|
||||
}
|
||||
return widget;
|
||||
return separatorBuilder(context, itemIndex);
|
||||
},
|
||||
findChildIndexCallback: findChildIndexCallback,
|
||||
childCount: _computeActualChildCount(itemCount),
|
||||
addAutomaticKeepAlives: addAutomaticKeepAlives,
|
||||
addRepaintBoundaries: addRepaintBoundaries,
|
||||
addSemanticIndexes: addSemanticIndexes,
|
||||
semanticIndexCallback: (Widget _, int index) {
|
||||
semanticIndexCallback: (Widget widget, int index) {
|
||||
return index.isEven ? index ~/ 2 : null;
|
||||
},
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user