PhotoView constructor

const PhotoView({
  1. Key? key,
  2. ValueNotifier? data,
  3. required ImageProvider<Object>? imageProvider,
  4. PageController? pageController,
  5. LoadingBuilder? loadingBuilder,
  6. BoxDecoration? backgroundDecoration,
  7. bool gaplessPlayback = false,
  8. PhotoViewHeroAttributes? heroAttributes,
  9. ValueChanged<PhotoViewScaleState>? scaleStateChangedCallback,
  10. bool enableRotation = false,
  11. PhotoViewControllerBase<PhotoViewControllerValue>? controller,
  12. PhotoViewScaleStateController? scaleStateController,
  13. dynamic maxScale,
  14. dynamic minScale,
  15. dynamic initialScale,
  16. Alignment? basePosition,
  17. ScaleStateCycle? scaleStateCycle,
  18. PhotoViewImageTapUpCallback? onTapUp,
  19. PhotoViewImageTapDownCallback? onTapDown,
  20. PhotoViewImageScaleEndCallback? onScaleEnd,
  21. Size? customSize,
  22. HitTestBehavior? gestureDetectorBehavior,
  23. bool? tightMode,
  24. FilterQuality? filterQuality,
  25. bool? disableGestures,
  26. ImageErrorWidgetBuilder? errorBuilder,
  27. bool? enablePanAlways,
  28. bool enableScaleAndDoubleTap = true,
})

Creates a widget that displays a zoomable image.

To show an image from the network or from an asset bundle, use their respective image providers, ie: AssetImage or NetworkImage

Internally, the image is rendered within an Image widget.

Implementation

const PhotoView({
  Key? key,
  this.data,
  required this.imageProvider,
  this.pageController,
  this.loadingBuilder,
  this.backgroundDecoration,
  this.gaplessPlayback = false,
  this.heroAttributes,
  this.scaleStateChangedCallback,
  this.enableRotation = false,
  this.controller,
  this.scaleStateController,
  this.maxScale,
  this.minScale,
  this.initialScale,
  this.basePosition,
  this.scaleStateCycle,
  this.onTapUp,
  this.onTapDown,
  this.onScaleEnd,
  this.customSize,
  this.gestureDetectorBehavior,
  this.tightMode,
  this.filterQuality,
  this.disableGestures,
  this.errorBuilder,
  this.enablePanAlways,
  this.enableScaleAndDoubleTap = true
})  : child = null,
      childSize = null,
      super(key: key);