XScrollView<T> constructor
const
XScrollView<T> ({
- required XScrollItemBuilder<
T> itemBuilder, - Key? key,
- XScrollFetcher<
T> ? onInit, - XScrollFetcher<
T> ? onLoadMore, - ValueChanged<
List< ? onItemsChanged,T> > - XScrollItemTap<
T> ? onItemTap, - List<
T> initialItems = const [], - bool initialHasMore = true,
- int pageSize = 20,
- bool autoLoad = true,
- bool enableRefresh = true,
- Axis scrollDirection = Axis.vertical,
- double refreshTriggerExtent = 80,
- double paginationThreshold = 200,
- ScrollController? controller,
- EdgeInsetsGeometry? padding,
- ScrollPhysics? physics,
- SliverGridDelegate? gridDelegate,
- IndexedWidgetBuilder? separatorBuilder,
- Widget? header,
- WidgetBuilder? loadingBuilder,
- WidgetBuilder? emptyBuilder,
- XScrollErrorBuilder? errorBuilder,
- WidgetBuilder? paginationLoadingBuilder,
- XScrollErrorBuilder? paginationErrorBuilder,
- XScrollRefreshIndicatorBuilder? refreshIndicatorBuilder,
- XScrollRefreshIndicatorBuilder? horizontalRefreshIndicatorBuilder,
- bool shrinkWrap = false,
- bool reverse = false,
- bool? primary,
- double? cacheExtent,
- ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
- String? restorationId,
- Clip clipBehavior = Clip.hardEdge,
Implementation
const XScrollView({
required this.itemBuilder,
super.key,
this.onInit,
this.onLoadMore,
this.onItemsChanged,
this.onItemTap,
this.initialItems = const [],
this.initialHasMore = true,
this.pageSize = 20,
this.autoLoad = true,
this.enableRefresh = true,
this.scrollDirection = Axis.vertical,
this.refreshTriggerExtent = 80,
this.paginationThreshold = 200,
this.controller,
this.padding,
this.physics,
this.gridDelegate,
this.separatorBuilder,
this.header,
this.footer,
this.loadingBuilder,
this.emptyBuilder,
this.errorBuilder,
this.paginationLoadingBuilder,
this.paginationErrorBuilder,
this.refreshIndicatorBuilder,
this.horizontalRefreshIndicatorBuilder,
this.shrinkWrap = false,
this.reverse = false,
this.primary,
this.cacheExtent,
this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual,
this.restorationId,
this.clipBehavior = Clip.hardEdge,
}) : assert(pageSize > 0),
assert(refreshTriggerExtent > 0),
assert(paginationThreshold >= 0);