TransformerPageView constructor
const
TransformerPageView({
- Key? key,
- int? index,
- Duration? duration,
- Curve curve = Curves.ease,
- double viewportFraction = 1.0,
- required bool loop,
- Axis scrollDirection = Axis.horizontal,
- ScrollPhysics? physics,
- bool pageSnapping = true,
- ValueChanged<
int> ? onPageChanged, - IndexController? controller,
- PageTransformer? transformer,
- bool allowImplicitScrolling = false,
- IndexedWidgetBuilder? itemBuilder,
- TransformerPageController? pageController,
- required int itemCount,
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 PageView compute the maximum
scroll extent.
itemBuilder
will be called only with indices greater than or equal to
zero and less than itemCount
.
Implementation
const TransformerPageView({
Key? key,
this.index,
Duration? duration,
this.curve = Curves.ease,
this.viewportFraction = 1.0,
required this.loop,
this.scrollDirection = Axis.horizontal,
this.physics,
this.pageSnapping = true,
this.onPageChanged,
this.controller,
this.transformer,
this.allowImplicitScrolling = false,
this.itemBuilder,
this.pageController,
required this.itemCount,
}) : assert(itemCount == 0 || itemBuilder != null || transformer != null),
duration = duration ??
const Duration(milliseconds: kDefaultTransactionDuration),
super(key: key);