ExtendedPageView.builder constructor
ExtendedPageView.builder({
- Key? key,
- Axis scrollDirection = Axis.horizontal,
- bool reverse = false,
- PageController? controller,
- ScrollPhysics? physics,
- bool pageSnapping = true,
- ValueChanged<
int> ? onPageChanged, - required IndexedWidgetBuilder itemBuilder,
- int? itemCount,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- bool allowImplicitScrolling = false,
- String? restorationId,
- Clip clipBehavior = Clip.hardEdge,
- int cacheExtent = 0,
- bool shouldIgnorePointerWhenScrolling = true,
Creates a scrollable list that works page by page using widgets that are created on demand.
This constructor is appropriate for page views with a large (or infinite) number of children because the builder is called only for those children that are actually visible.
Providing a non-null itemCount
lets the ExtendedPageView compute the maximum
scroll extent.
itemBuilder
will be called only with indices greater than or equal to
zero and less than itemCount
.
Implementation
ExtendedPageView.builder({
Key? key,
this.scrollDirection = Axis.horizontal,
this.reverse = false,
PageController? controller,
this.physics,
this.pageSnapping = true,
this.onPageChanged,
required IndexedWidgetBuilder itemBuilder,
int? itemCount,
this.dragStartBehavior = DragStartBehavior.start,
this.allowImplicitScrolling = false,
this.restorationId,
this.clipBehavior = Clip.hardEdge,
this.cacheExtent = 0,
this.shouldIgnorePointerWhenScrolling = true,
}) : controller = controller ?? _defaultPageController,
childrenDelegate =
SliverChildBuilderDelegate(itemBuilder, childCount: itemCount),
super(key: key);