ExtendedPhotoGallery class
An extended PhotoViewGallery
, which is used to show multiple PhotoView
widgets in a PageView. Extended
features include: reload behavior (through ExtendedPhotoGalleryState.reloadPhoto), custom viewport factor,
advance page builder (through ExtendedPhotoGallery.advanced).
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ExtendedPhotoGallery
Constructors
-
ExtendedPhotoGallery({Key? key, required List<
ExtendedPhotoGalleryPageOptions> pageOptions, PhotoViewOptions? fallbackOptions, void onPageChanged(int index)?, PageController? pageController, bool reverse = false, ScrollPhysics? scrollPhysics, Axis scrollDirection = Axis.horizontal, bool keepViewportMainAxisSize = true, double? fractionWidthFactor, double? fractionHeightFactor, ValueChanged<PageMetrics> ? onPageMetricsChanged, bool callPageChangedAtEnd = true, double? pageMainAxisHintSize, int preloadPagesCount = 0}) -
Constructs a gallery with static photo pages through a list of ExtendedPhotoGalleryPageOptions.
const
-
ExtendedPhotoGallery.advanced({Key? key, required int pageCount, required ExtendedPhotoGalleryPageOptionsBuilder builder, required AdvancedPhotoGalleryPageBuilder advancedBuilder, PhotoViewOptions? fallbackOptions, void onPageChanged(int index)?, PageController? pageController, bool reverse = false, Axis scrollDirection = Axis.horizontal, ScrollPhysics? scrollPhysics, bool keepViewportMainAxisSize = true, double? fractionWidthFactor, double? fractionHeightFactor, ValueChanged<
PageMetrics> ? onPageMetricsChanged, bool callPageChangedAtEnd = true, double? pageMainAxisHintSize, int preloadPagesCount = 0}) -
Constructs a gallery with advanced page builder, by builder and advancedBuilder.
const
-
ExtendedPhotoGallery.builder({Key? key, required int pageCount, required ExtendedPhotoGalleryPageOptionsBuilder builder, PhotoViewOptions? fallbackOptions, void onPageChanged(int index)?, PageController? pageController, bool reverse = false, Axis scrollDirection = Axis.horizontal, ScrollPhysics? scrollPhysics, bool keepViewportMainAxisSize = true, double? fractionWidthFactor, double? fractionHeightFactor, ValueChanged<
PageMetrics> ? onPageMetricsChanged, bool callPageChangedAtEnd = true, double? pageMainAxisHintSize, int preloadPagesCount = 0}) -
Constructs a gallery with dynamic photo pages. The builder must return a ExtendedPhotoGalleryPageOptions.
const
Properties
- advancedBuilder → AdvancedPhotoGalleryPageBuilder?
-
Called to build all pages (not only photo pages) for the gallery, note that builder will be called through
photoPageBuilder
, so index passed tophotoPageBuilder
should exclude non-photo pages.final - builder → ExtendedPhotoGalleryPageOptionsBuilder?
-
Called to build photo pages for the gallery, here index should exclude non-photo pages.
final
- callPageChangedAtEnd → bool
-
The flag to call onPageChanged when page changing is finished, defaults to true, and this means it will
behave the same as builtin PageView.
final
- fallbackOptions → PhotoViewOptions?
-
The fallback options for photo pages, which has almost the same fields as ExtendedPhotoGalleryPageOptions.
final
- fractionHeightFactor → double?
-
The height factor for each fractional photo page. Note that valid fractionHeightFactor (positive value) will
disable keepViewportMainAxisSize when scroll vertically.
final
- fractionWidthFactor → double?
-
The width factor for each fractional photo page. Note that valid fractionWidthFactor (positive value) will
disable keepViewportMainAxisSize when scroll horizontally.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- keepViewportMainAxisSize → bool
-
The flag to keep main axis size of each photo page to origin size (which is the same as default identical
viewport fraction), defaults to false.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onPageChanged → (void Function(int index)?)
-
A callback to be called on a page change.
final
-
onPageMetricsChanged
→ ValueChanged<
PageMetrics> ? -
The callback that will be invoked when PageMetrics changed, and callPageChangedAtEnd has no influence on
this callback.
final
- pageController → PageController?
-
An object that controls the PageView inside ExtendedPhotoGallery.
final
- pageCount → int?
-
The count of pages (not only photo pages) in the gallery, only used when constructed via
ExtendedPhotoGallery.builder and ExtendedPhotoGallery.advancedBuilder.
final
- pageMainAxisHintSize → double?
-
Mirrors to PreloadablePageView.pageMainAxisHintSize.
final
-
pageOptions
→ List<
ExtendedPhotoGalleryPageOptions> ? -
The list of options to describe the photo pages in the gallery.
final
- preloadPagesCount → int
-
Mirrors to PreloadablePageView.preloadPagesCount.
final
- reverse → bool
-
The flag to determine whether the page view scrolls in the reading direction.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollDirection → Axis
-
The axis along which the PageView scrolls. Mirrors to PageView.scrollDirection.
final
- scrollPhysics → ScrollPhysics?
-
The ScrollPhysics for the internal PageView.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< StatefulWidget> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited