ソースを参照

Add param to cover the screen

vishnukvmd 2 年 前
コミット
8508035be0
1 ファイル変更5 行追加1 行削除
  1. 5 1
      lib/ui/viewer/file/zoomable_image.dart

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

@@ -25,6 +25,7 @@ class ZoomableImage extends StatefulWidget {
   final Function(bool)? shouldDisableScroll;
   final String? tagPrefix;
   final Decoration? backgroundDecoration;
+  final bool shouldCover;
 
   const ZoomableImage(
     this.photo, {
@@ -32,6 +33,7 @@ class ZoomableImage extends StatefulWidget {
     this.shouldDisableScroll,
     required this.tagPrefix,
     this.backgroundDecoration,
+    this.shouldCover = false,
   }) : super(key: key);
 
   @override
@@ -93,7 +95,9 @@ class _ZoomableImageState extends State<ZoomableImage>
           imageProvider: _imageProvider,
           controller: _photoViewController,
           scaleStateChangedCallback: _scaleStateChangedCallback,
-          minScale: PhotoViewComputedScale.contained,
+          minScale: widget.shouldCover
+              ? PhotoViewComputedScale.covered
+              : PhotoViewComputedScale.contained,
           gaplessPlayback: true,
           heroAttributes: PhotoViewHeroAttributes(
             tag: widget.tagPrefix! + _photo.tag,