Pārlūkot izejas kodu

Add an option to set a background to the zoomable image

Vishnu Mohandas 5 gadi atpakaļ
vecāks
revīzija
904c63f040
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      lib/ui/zoomable_image.dart

+ 4 - 0
lib/ui/zoomable_image.dart

@@ -1,5 +1,6 @@
 import 'package:cached_network_image/cached_network_image.dart';
 import 'package:cached_network_image/cached_network_image.dart';
 import 'package:flutter/foundation.dart';
 import 'package:flutter/foundation.dart';
+import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
 import 'package:flutter/widgets.dart';
 import 'package:logging/logging.dart';
 import 'package:logging/logging.dart';
 import 'package:photos/core/cache/image_cache.dart';
 import 'package:photos/core/cache/image_cache.dart';
@@ -13,12 +14,14 @@ class ZoomableImage extends StatefulWidget {
   final File photo;
   final File photo;
   final Function(bool) shouldDisableScroll;
   final Function(bool) shouldDisableScroll;
   final String tagPrefix;
   final String tagPrefix;
+  final Decoration backgroundDecoration;
 
 
   ZoomableImage(
   ZoomableImage(
     this.photo, {
     this.photo, {
     Key key,
     Key key,
     this.shouldDisableScroll,
     this.shouldDisableScroll,
     @required this.tagPrefix,
     @required this.tagPrefix,
+    this.backgroundDecoration,
   }) : super(key: key);
   }) : super(key: key);
 
 
   @override
   @override
@@ -63,6 +66,7 @@ class _ZoomableImageState extends State<ZoomableImage>
         heroAttributes: PhotoViewHeroAttributes(
         heroAttributes: PhotoViewHeroAttributes(
           tag: widget.tagPrefix + widget.photo.tag(),
           tag: widget.tagPrefix + widget.photo.tag(),
         ),
         ),
+        backgroundDecoration: widget.backgroundDecoration,
       );
       );
     } else {
     } else {
       return loadWidget;
       return loadWidget;