SwipeImageGallery class
Constructors
-
SwipeImageGallery({required BuildContext context, List<
Widget> ? children, IndexedWidgetBuilder? itemBuilder, int? itemCount, bool hideStatusBar = true, int initialIndex = 0, Color backgroundColor = Colors.black, int dismissDragDistance = 160, int transitionDuration = 400, bool hideOverlayOnTap = true, double zoom = 8.0, double backgroundOpacity = 1.0, ImageGalleryController? controller, void onSwipe(int)?, StreamController<Widget> ? overlayController, Widget? initialOverlay, List<ImageGalleryHeroProperties> ? heroProperties}) - A scrollable, dismissable by swiping, zoomable, rotatable image gallery on which you can add a dynamic overlay.
Properties
- backgroundColor → Color
-
The color to show behind the displayed images.
final
- backgroundOpacity → double
-
Background opacity between 0-1 and defaults to 1.
final
-
children
→ List<
Widget> ? -
A list of widgets to display in the gallery if itemBuilder
is not used.
final
- context → BuildContext
-
BuildContext required for triggering the dialogs for the gallery.
final
- controller → ImageGalleryController?
-
The controller for the image gallery, extends PageController.
final
- dismissDragDistance → int
-
The drag distance needed before the gallery can be dismissed.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
heroProperties
→ List<
ImageGalleryHeroProperties> ? -
The parameters required to initialise the hero animations.
Can be sent as a list for a gallery view ui that displays more
than one image before opening the fullscreen gallery.
final
- hideOverlayOnTap → bool
-
Whether the overlay should be hidden when the user taps on the gallery.
Works with overlayController.
final
- hideStatusBar → bool
-
Hides the status bar when the gallery opens and shows it again when
it's dismissed if set to true using
SystemChrome.setEnabledSystemUIMode.
final
- initialIndex → int
-
Sets the initial index of the gallery when it's first opening.
Only works unless it is specifically set in the ImageGalleryController.
final
- initialOverlay → Widget?
-
Used for displaying an overlay as soon as the gallery is opened.
Uses the StreamBuilder.initialData to display the widget.
final
- itemBuilder → IndexedWidgetBuilder?
-
Works together with itemCount for building items in one method.
A simple usage with a list of urls would be as below:
final
- itemCount → int?
-
Count of items to build with the itemBuilder.
final
- onSwipe → (void Function(int)?)
-
Called whenever the current image index changes.
final
-
overlayController
→ StreamController<
Widget> ? -
The
overlayController
is used for adding and managing the overlay widget changes. It uses a StreamController so that the changes made outside of the gallery can be pushed into it and shown in the UI.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transitionDuration → int
-
The transition duration for the animation of opening and closing
the gallery.
final
- zoom → double
-
Amount of zoom allowed.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
show(
) → void - Shows the image gallery after initialisation.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited