PhotoViewGallery.builder constructor Null safety

const PhotoViewGallery.builder(
  1. {Key? key,
  2. required int? itemCount,
  3. required PhotoViewGalleryBuilder? builder,
  4. LoadingBuilder? loadingBuilder,
  5. BoxDecoration? backgroundDecoration,
  6. bool wantKeepAlive = false,
  7. bool gaplessPlayback = false,
  8. bool reverse = false,
  9. PageController? pageController,
  10. PhotoViewGalleryPageChangedCallback? onPageChanged,
  11. ValueChanged<PhotoViewScaleState>? scaleStateChangedCallback,
  12. bool enableRotation = false,
  13. ScrollPhysics? scrollPhysics,
  14. Axis scrollDirection = Axis.horizontal,
  15. Size? customSize,
  16. bool allowImplicitScrolling = false}
)

Construct a gallery with dynamic items.

The builder must return a PhotoViewGalleryPageOptions.

Implementation

const PhotoViewGallery.builder({
  Key? key,
  required this.itemCount,
  required this.builder,
  this.loadingBuilder,
  this.backgroundDecoration,
  this.wantKeepAlive = false,
  this.gaplessPlayback = false,
  this.reverse = false,
  this.pageController,
  this.onPageChanged,
  this.scaleStateChangedCallback,
  this.enableRotation = false,
  this.scrollPhysics,
  this.scrollDirection = Axis.horizontal,
  this.customSize,
  this.allowImplicitScrolling = false,
})  : pageOptions = null,
      assert(itemCount != null),
      assert(builder != null),
      super(key: key);