Skip to content

Commit

Permalink
Fix image download button appearance on light mode
Browse files Browse the repository at this point in the history
  • Loading branch information
coslu committed Jul 3, 2023
1 parent e2fc98a commit 301d554
Showing 1 changed file with 44 additions and 48 deletions.
92 changes: 44 additions & 48 deletions lib/shared/image_viewer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,12 @@ class _ImageViewerState extends State<ImageViewer> {

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return Scaffold(
backgroundColor: Colors.black.withOpacity(0.95),
body: Stack(
children: [
Positioned(
top: 50,
right: 15,
child: IconButton(
color: theme.textTheme.titleLarge?.color,
appBar: AppBar(
backgroundColor: Colors.black,
foregroundColor: Colors.white,
actions: [
IconButton(
onPressed: () async {
File file = await DefaultCacheManager().getSingleFile(widget.url);

Expand All @@ -70,49 +66,49 @@ class _ImageViewerState extends State<ImageViewer> {
},
icon: downloaded ? const Icon(Icons.check_circle, semanticLabel: 'Downloaded') : const Icon(Icons.download, semanticLabel: "Download"),
),
),
Center(
child: ExtendedImageSlidePage(
key: slidePagekey,
slideAxis: SlideAxis.both,
],
),
backgroundColor: Colors.black,
body: Center(
child: ExtendedImageSlidePage(
key: slidePagekey,
slideAxis: SlideAxis.both,
slideType: SlideType.onlyImage,
child: GestureDetector(
child: HeroWidget(
tag: widget.url,
slideType: SlideType.onlyImage,
child: GestureDetector(
child: HeroWidget(
tag: widget.url,
slideType: SlideType.onlyImage,
slidePagekey: slidePagekey,
child: ExtendedImage.network(
widget.url,
enableSlideOutPage: true,
mode: ExtendedImageMode.gesture,
cache: true,
clearMemoryCacheWhenDispose: true,
initGestureConfigHandler: (ExtendedImageState state) {
return GestureConfig(
minScale: 0.9,
animationMinScale: 0.7,
maxScale: 4.0,
animationMaxScale: 4.5,
speed: 1.0,
inertialSpeed: 100.0,
initialScale: 1.0,
inPageView: false,
initialAlignment: InitialAlignment.center,
reverseMousePointerScrollDirection: true,
gestureDetailsIsChanged: (GestureDetails? details) {},
);
},
),
),
onTap: () {
slidePagekey.currentState!.popPage();
Navigator.pop(context);
slidePagekey: slidePagekey,
child: ExtendedImage.network(
widget.url,
enableSlideOutPage: true,
mode: ExtendedImageMode.gesture,
cache: true,
clearMemoryCacheWhenDispose: true,
initGestureConfigHandler: (ExtendedImageState state) {
return GestureConfig(
minScale: 0.9,
animationMinScale: 0.7,
maxScale: 4.0,
animationMaxScale: 4.5,
speed: 1.0,
inertialSpeed: 100.0,
initialScale: 1.0,
inPageView: false,
initialAlignment: InitialAlignment.center,
reverseMousePointerScrollDirection: true,
gestureDetailsIsChanged: (GestureDetails? details) {},
);
},
),
),
)
],
),
onTap: () {
slidePagekey.currentState!.popPage();
Navigator.pop(context);
},
),
),
)
);
}
}

0 comments on commit 301d554

Please sign in to comment.