Add an option to set a background to the zoomable image
This commit is contained in:
parent
66c793bf76
commit
904c63f040
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue