Bladeren bron

Added: Extra parameters to the photoViewGalleryPageOption widget

Muhammed Ayimen 1 jaar geleden
bovenliggende
commit
d84eefa2ea
1 gewijzigde bestanden met toevoegingen van 7 en 1 verwijderingen
  1. 7 1
      lib/ui/viewer/file/zoomable_image.dart

+ 7 - 1
lib/ui/viewer/file/zoomable_image.dart

@@ -91,13 +91,19 @@ class _ZoomableImageState extends State<ZoomableImage>
 
 
     if (_imageProvider != null) {
     if (_imageProvider != null) {
       content = PhotoViewGallery.builder(
       content = PhotoViewGallery.builder(
+        gaplessPlayback: true,
+        scaleStateChangedCallback: _scaleStateChangedCallback,
+        backgroundDecoration: widget.backgroundDecoration as BoxDecoration?,
         builder: (context, index) {
         builder: (context, index) {
           return PhotoViewGalleryPageOptions(
           return PhotoViewGalleryPageOptions(
             imageProvider: _imageProvider!,
             imageProvider: _imageProvider!,
-            minScale: PhotoViewComputedScale.contained,
+            minScale: widget.shouldCover
+                ? PhotoViewComputedScale.covered
+                : PhotoViewComputedScale.contained,
             heroAttributes: PhotoViewHeroAttributes(
             heroAttributes: PhotoViewHeroAttributes(
               tag: widget.tagPrefix! + _photo.tag,
               tag: widget.tagPrefix! + _photo.tag,
             ),
             ),
+            controller: _photoViewController,
           );
           );
         },
         },
         itemCount: 1,
         itemCount: 1,