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