GesturePageView constructor
- Key? key,
- Axis scrollDirection = Axis.horizontal,
- bool reverse = false,
- ExtendedPageController? controller,
- ScrollPhysics? physics,
- bool pageSnapping = true,
- ValueChanged<
int> ? onPageChanged, - List<
Widget> children = const <Widget>[], - DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- bool allowImplicitScrolling = false,
- String? restorationId,
- Clip clipBehavior = Clip.hardEdge,
- ScrollBehavior? scrollBehavior,
- bool padEnds = true,
- int preloadPagesCount = 0,
Creates a scrollable list that works page by page from an explicit List of widgets.
This constructor is appropriate for page views with a small number of children because constructing the List requires doing work for every child that could possibly be displayed in the page view, instead of just those children that are actually visible.
Like other widgets in the framework, this widget expects that
the children
list will not be mutated after it has been passed in here.
See the documentation at SliverChildListDelegate.children for more details.
If allowImplicitScrolling
is true, the PageView will participate in
accessibility scrolling more like a ListView, where implicit scroll
actions will move to the next page rather than into the contents of the
PageView.
Implementation
GesturePageView({
Key? key,
this.scrollDirection = Axis.horizontal,
this.reverse = false,
ExtendedPageController? controller,
this.physics,
this.pageSnapping = true,
this.onPageChanged,
List<Widget> children = const <Widget>[],
this.dragStartBehavior = DragStartBehavior.start,
this.allowImplicitScrolling = false,
this.restorationId,
this.clipBehavior = Clip.hardEdge,
this.scrollBehavior,
this.padEnds = true,
this.preloadPagesCount = 0,
}) : assert(allowImplicitScrolling != null),
assert(clipBehavior != null),
controller = controller ?? _defaultPageController,
childrenDelegate = SliverChildListDelegate(children),
super(key: key);