InfiniteScrollListView<T>.list constructor
InfiniteScrollListView<T>.list ({
- Key? key,
- required Future<
List< fetchNext(),T> > - Future<
List< fetchPrev()?,T> > - required Widget itemBuilder(
- BuildContext context,
- T item,
- int index
- void onIndexChanged()?,
- Key? dataKey,
- ScrollPhysics? physics,
- Axis scrollDirection = Axis.vertical,
- bool? primary,
- int initialIndex()?,
- bool initialIndexNotFoundCallback()?,
- ScrollController? controller,
- Clip clipBehavior = Clip.hardEdge,
- double? cacheExtent,
- List<
Widget> ? overlaySlivers, - EdgeInsets? padding,
- bool canRefresh = true,
- Widget refreshIndicatorBuilder(
- BuildContext context,
- Widget child,
- Future<
void> refresh()
- Widget? prefix,
- Widget? suffix,
- Widget? empty,
- Widget? loading,
- Widget? loadingMore,
- Widget errorBuilder(
- BuildContext context,
- Object error
- void onRefresh()?,
- bool canFetchNext(
- int index
- bool canFetchPrev(
- int index
Creates an infinite scrolling list view.
Implementation
InfiniteScrollListView.list({
super.key,
required this.fetchNext,
this.fetchPrev,
required this.itemBuilder,
this.onIndexChanged,
this.dataKey,
this.physics,
this.scrollDirection = Axis.vertical,
this.primary,
this.initialIndex,
this.initialIndexNotFoundCallback,
this.controller,
this.clipBehavior = Clip.hardEdge,
this.cacheExtent,
this.overlaySlivers,
this.padding,
this.canRefresh = true,
this.refreshIndicatorBuilder,
this.prefix,
this.suffix,
this.empty,
this.loading,
this.loadingMore,
this.errorBuilder,
this.onRefresh,
this.canFetchNext,
this.canFetchPrev,
}) : gridDelegate = null,
_listBuilder = ((context, itemBuilder, count) => SliverList(
delegate: SliverChildBuilderDelegate(
childCount: count,
itemBuilder,
),
));