PhotoView class
Constructors
PhotoView.new ({Key ? key , required Widget child , Size ? childSize , BoxDecoration ? backgroundDecoration , bool wantKeepAlive = false , PhotoViewHeroAttributes? heroAttributes , ValueChanged <PhotoViewScaleState > ? scaleStateChangedCallback , bool enableRotation = false , PhotoViewControllerBase <PhotoViewControllerValue > ? controller , PhotoViewScaleStateController ? scaleStateController , dynamic maxScale , dynamic minScale , dynamic initialScale , Alignment ? basePosition , ScaleStateCycle ? scaleStateCycle , PhotoViewImageTapUpCallback ? onTapUp , PhotoViewImageTapDownCallback ? onTapDown , PhotoViewImageScaleEndCallback ? onScaleEnd , Size ? customSize , HitTestBehavior ? gestureDetectorBehavior , bool ? tightMode , FilterQuality ? filterQuality , bool ? disableGestures , bool ? enablePanAlways , bool ? strictScale })
const
Properties
backgroundDecoration
→ BoxDecoration ?
Changes the background behind image, defaults to Colors.black
.
final
basePosition
→ Alignment ?
The alignment of the scale origin in relation to the widget size. Default is Alignment.center
final
child
→ Widget
The specified custom child to be shown instead of a image
final
childSize
→ Size ?
The size of the custom child . PhotoView uses this value to compute the relation between the child and the container's size to calculate the scale value.
final
controller
→ PhotoViewControllerBase <PhotoViewControllerValue > ?
A way to control PhotoView transformation factors externally and listen to its updates
final
customSize
→ Size ?
Defines the size of the scaling base of the image inside PhotoView ,
by default it is MediaQuery.of(context).size
.
final
disableGestures
→ bool ?
final
enablePanAlways
→ bool ?
Enable pan the widget even if it's smaller than the hole parent widget.
Useful when you want to drag a widget without restrictions.
final
enableRotation
→ bool
A flag that enables the rotation gesture support
final
errorBuilder
→ ImageErrorWidgetBuilder ?
Show loadFailedChild when the image failed to load
final
filterQuality
→ FilterQuality ?
Quality levels for image filters.
final
gaplessPlayback
→ bool
This is used to continue showing the old image (true
), or briefly show
nothing (false
), when the imageProvider
changes. By default it's set
to false
.
final
gestureDetectorBehavior
→ HitTestBehavior ?
HitTestBehavior to be passed to the internal gesture detector.
final
hashCode
→ int
The hash code for this object.
no setter inherited
heroAttributes
→ PhotoViewHeroAttributes?
Attributes that are going to be passed to PhotoViewCore
's
Hero . Leave this property undefined if you don't want a hero animation.
final
imageData
→ Uint8List ?
Given a imageData it resolves into an zoomable image widget using. It
is required
final
initialScale
→ dynamic
Defines the initial size in which the image will be assume in the mounting of the component, it
is proportional to the original image size. Can be either a double (absolute value) or a
PhotoViewComputedScale , that can be multiplied by a double
final
key
→ Key ?
Controls how one widget replaces another widget in the tree.
final inherited
loadingBuilder
→ LoadingBuilder ?
While imageData is not resolved, loadingBuilder is called by PhotoView
into the screen, by default it is a centered CircularProgressIndicator
final
maxScale
→ dynamic
Defines the maximum size in which the image will be allowed to assume, it
is proportional to the original image size. Can be either a double (absolute value) or a
PhotoViewComputedScale , that can be multiplied by a double
final
minScale
→ dynamic
Defines the minimum size in which the image will be allowed to assume, it
is proportional to the original image size. Can be either a double (absolute value) or a
PhotoViewComputedScale , that can be multiplied by a double
final
onScaleEnd
→ PhotoViewImageScaleEndCallback ?
A pointer that will trigger a scale has stopped contacting the screen at a
particular location.
final
onTapDown
→ PhotoViewImageTapDownCallback ?
A pointer that might cause a tap has contacted the screen at a particular
location.
final
onTapUp
→ PhotoViewImageTapUpCallback ?
A pointer that will trigger a tap has stopped contacting the screen at a
particular location.
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
scaleStateChangedCallback
→ ValueChanged <PhotoViewScaleState > ?
A Function to be called whenever the scaleState changes, this happens when the user double taps the content ou start to pinch-in.
final
scaleStateController
→ PhotoViewScaleStateController ?
A way to control PhotoViewScaleState value externally and listen to its updates
final
scaleStateCycle
→ ScaleStateCycle ?
Defines de next PhotoViewScaleState given the actual one. Default is defaultScaleStateCycle
final
semanticLabel
→ String ?
A Semantic description of the image.
final
strictScale
→ bool ?
Enable strictScale will restrict user scale gesture to the maxScale and minScale values.
final
tightMode
→ bool ?
Enables tight mode, making background container assume the size of the image/child.
Useful when inside a Dialog
final
wantKeepAlive
→ bool
This is used to keep the state of an image in the gallery (e.g. scale state).
false
-> resets the state (default)
true
-> keeps the state
final