我想制作无限滚动的列表视图,所以我使用了https://pub.dev/packages/infinite_listview库。现在,我有一个错误告诉我RangeError(索引):无效值:不在范围0..9,包括:-1和RangeError(索引):无效值:不在范围0..9,包括:10 从双方。帮帮我;)
class ListPhotosWidget extends StatelessWidget {
final PhotosList photosList;
ListPhotosWidget({Key key, @required this.photosList}) : super(key: key);
<code> InfiniteScrollController _controller =
InfiniteScrollController(initialScrollOffset: 0.0);
@override
Widget build(BuildContext context) {
return InfiniteListView.builder(
controller: _controller,
itemBuilder: (BuildContext context, int index) {
return PhotoItem(photo: photosList.photos[index]);
},
);
}
}