TransformerPageView constructor

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

TransformerPageView({
  Key? key,
  this.index,
  Duration? duration,
  this.curve: Curves.ease,
  this.viewportFraction: 1.0,
  this.loop: false,
  this.scrollDirection = Axis.horizontal,
  this.physics,
  this.pageSnapping = true,
  this.onPageChanged,
  this.controller,
  this.transformer,
  this.itemBuilder,
  this.pageController,
  required this.itemCount,
})  : assert(itemCount == 0 || itemBuilder != null || transformer != null),
      this.duration =
          duration ?? new Duration(milliseconds: kDefaultTransactionDuration),
      super(key: key);