easy_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
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, bool doubleTapZoomable = false, Color backgroundColor = _defaultBackgroundColor, String closeButtonTooltip = _defaultCloseButtonTooltip, Color closeButtonColor = _defaultCloseButtonColor}) Future<Dialog?>
Shows the given imageProvider in a full-screen Dialog. Setting immersive to false will prevent the top and bottom bars from being hidden. The optional onViewerDismissed callback function is called when the dialog is closed. The optional useSafeArea boolean defaults to false and is passed to showDialog. The optional swipeDismissible boolean defaults to false and allows swipe-down-to-dismiss. The optional doubleTapZoomable boolean defaults to false and allows double tap to zoom. The backgroundColor defaults to black, but can be set to any other color. The closeButtonTooltip text is displayed when the user long-presses on the close button and is used for accessibility. The closeButtonColor 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, bool doubleTapZoomable = false, bool infinitelyScrollable = 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. Setting immersive to false will prevent the top and bottom bars from being hidden. The optional onPageChanged callback function is called with the index of the image when the user has swiped to another image. The optional onViewerDismissed callback function is called with the index of the image that is displayed when the dialog is closed. The optional useSafeArea boolean defaults to false and is passed to showDialog. The optional swipeDismissible boolean defaults to false and allows swipe-down-to-dismiss. The optional doubleTapZoomable boolean defaults to false and allows double tap to zoom. The optional infinitelyScrollable boolean defaults to false and allows infinite scrolling. The backgroundColor defaults to black, but can be set to any other color. The closeButtonTooltip text is displayed when the user long-presses on the close button and is used for accessibility. The closeButtonColor defaults to white, but can be set to any other color.