TransformerPageView constructor

const TransformerPageView({
  1. Key? key,
  2. int? index,
  3. Duration? duration,
  4. Curve curve = Curves.ease,
  5. double viewportFraction = 1.0,
  6. required bool loop,
  7. Axis scrollDirection = Axis.horizontal,
  8. ScrollPhysics? physics,
  9. bool pageSnapping = true,
  10. ValueChanged<int>? onPageChanged,
  11. IndexController? controller,
  12. PageTransformer? transformer,
  13. bool allowImplicitScrolling = false,
  14. IndexedWidgetBuilder? itemBuilder,
  15. TransformerPageController? pageController,
  16. 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);