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
imageProviderin a full-screen Dialog. Settingimmersiveto false will prevent the top and bottom bars from being hidden. The optionalonViewerDismissedcallback function is called when the dialog is closed. The optionaluseSafeAreaboolean defaults to false and is passed to showDialog. The optionalswipeDismissibleboolean defaults to false and allows swipe-down-to-dismiss. The optionaldoubleTapZoomableboolean defaults to false and allows double tap to zoom. ThebackgroundColordefaults to black, but can be set to any other color. ThecloseButtonTooltiptext is displayed when the user long-presses on the close button and is used for accessibility. ThecloseButtonColordefaults 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
imageProviderin a full-screen PageView Dialog. Settingimmersiveto false will prevent the top and bottom bars from being hidden. The optionalonPageChangedcallback function is called with the index of the image when the user has swiped to another image. The optionalonViewerDismissedcallback function is called with the index of the image that is displayed when the dialog is closed. The optionaluseSafeAreaboolean defaults to false and is passed to showDialog. The optionalswipeDismissibleboolean defaults to false and allows swipe-down-to-dismiss. The optionaldoubleTapZoomableboolean defaults to false and allows double tap to zoom. The optionalinfinitelyScrollableboolean defaults to false and allows infinite scrolling. ThebackgroundColordefaults to black, but can be set to any other color. ThecloseButtonTooltiptext is displayed when the user long-presses on the close button and is used for accessibility. ThecloseButtonColordefaults to white, but can be set to any other color.