From df772477ec1aed6bc055f5874cd4fb61acc1660d Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Tue, 3 May 2022 14:19:01 +0530 Subject: [PATCH] Fix photoviewer for light theme --- lib/ui/detail_page.dart | 4 +++- lib/ui/fading_app_bar.dart | 10 ++++++---- lib/ui/fading_bottom_bar.dart | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/ui/detail_page.dart b/lib/ui/detail_page.dart index 531f6a577..ca1c551d1 100644 --- a/lib/ui/detail_page.dart +++ b/lib/ui/detail_page.dart @@ -123,7 +123,8 @@ class _DetailPageState extends State { ], ), ), - backgroundColor: Colors.black, + + // backgroundColor: Theme.of(context).colorScheme.onPrimary, ); } @@ -148,6 +149,7 @@ class _DetailPageState extends State { _toggleFullScreen(); }); }, + backgroundDecoration: BoxDecoration(color: Colors.transparent), ); _preloadFiles(index); return GestureDetector( diff --git a/lib/ui/fading_app_bar.dart b/lib/ui/fading_app_bar.dart index 3e4676aa7..8b47aa37d 100644 --- a/lib/ui/fading_app_bar.dart +++ b/lib/ui/fading_app_bar.dart @@ -53,6 +53,7 @@ class FadingAppBarState extends State { @override Widget build(BuildContext context) { + Color barColor = Theme.of(context).colorScheme.onSurface; return CustomAppBar( AnimatedOpacity( child: Container( @@ -61,8 +62,8 @@ class FadingAppBarState extends State { begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [ - Colors.black.withOpacity(0.64), - Colors.black.withOpacity(0.5), + barColor.withOpacity(0.64), + barColor.withOpacity(0.5), Colors.transparent, ], stops: const [0, 0.2, 1], @@ -179,7 +180,6 @@ class FadingAppBarState extends State { ), ), actions: shouldShowActions ? actions : [], - backgroundColor: Color(0x00000000), elevation: 0, ); } @@ -235,7 +235,9 @@ class FadingAppBarState extends State { likeBuilder: (isLiked) { return Icon( Icons.favorite_border, - color: isLiked ? Colors.pinkAccent : Colors.white, + color: isLiked + ? Colors.pinkAccent + : Theme.of(context).colorScheme.onSurface, size: 24, ); }, diff --git a/lib/ui/fading_bottom_bar.dart b/lib/ui/fading_bottom_bar.dart index 217b8f146..45bfad5e6 100644 --- a/lib/ui/fading_bottom_bar.dart +++ b/lib/ui/fading_bottom_bar.dart @@ -154,8 +154,8 @@ class FadingBottomBarState extends State { end: Alignment.bottomCenter, colors: [ Colors.transparent, - Colors.black.withOpacity(0.5), - Colors.black.withOpacity(0.64), + Theme.of(context).colorScheme.onPrimary.withOpacity(0.12), + Theme.of(context).colorScheme.onPrimary.withOpacity(0.2), ], stops: const [0, 0.8, 1], ),