gallery_image_viewer library
A library to easily display images in a full-screen dialog. It supports pinch & zoom, and paging through multiple images.
Classes
- EasyImageProvider
- Provider for images, their count and the initial index to display
- EasyImageView
- A full-sized view that displays the given image, supporting pinch & zoom
- EasyImageViewPager
- PageView for swiping through a list of images
- GalleryImageView
- MultiImageProvider
- Convenience provider for a list of ImageProviders
- SingleImageProvider
- Convenience provider for a single image
Functions
-
showImageViewer(
BuildContext context, ImageProvider< Object> imageProvider, {bool immersive = true, void onViewerDismissed()?, bool useSafeArea = false, bool swipeDismissible = false, Color backgroundColor = _defaultBackgroundColor, String closeButtonTooltip = _defaultCloseButtonTooltip, Color closeButtonColor = _defaultCloseButtonColor}) → Future<Dialog?> -
Shows the given
imageProvider
in a full-screen Dialog. Settingimmersive
to false will prevent the top and bottom bars from being hidden. The optionalonViewerDismissed
callback function is called when the dialog is closed. The optionaluseSafeArea
boolean defaults to false and is passed to showDialog. The optionalswipeDismissible
boolean defaults to false allows swipe-down-to-dismiss. ThebackgroundColor
defaults to black, but can be set to any other color. ThecloseButtonTooltip
text is displayed when the user long-presses on the close button and is used for accessibility. ThecloseButtonColor
defaults to white, but can be set to any other color. -
showImageViewerPager(
BuildContext context, EasyImageProvider imageProvider, {bool immersive = true, void onPageChanged(int)?, void onViewerDismissed(int)?, bool useSafeArea = false, bool swipeDismissible = false, Color backgroundColor = _defaultBackgroundColor, String closeButtonTooltip = _defaultCloseButtonTooltip, Color closeButtonColor = _defaultCloseButtonColor}) → Future< Dialog?> -
Shows the images provided by the
imageProvider
in a full-screen PageView Dialog. Settingimmersive
to false will prevent the top and bottom bars from being hidden. The optionalonPageChanged
callback function is called with the index of the image when the user has swiped to another image. The optionalonViewerDismissed
callback function is called with the index of the image that is displayed when the dialog is closed. The optionaluseSafeArea
boolean defaults to false and is passed to showDialog. The optionalswipeDismissible
boolean defaults to false allows swipe-down-to-dismiss. ThebackgroundColor
defaults to black, but can be set to any other color. ThecloseButtonTooltip
text is displayed when the user long-presses on the close button and is used for accessibility. ThecloseButtonColor
defaults to white, but can be set to any other color.