From bfcdb45021416cf282c3cce9a525f0619f9b980f Mon Sep 17 00:00:00 2001 From: Chaphasilor Date: Wed, 31 Jul 2024 15:29:44 +0200 Subject: [PATCH] use current accent color to highlight playing track - hopefully this doesn't have a huge performance impact... --- .../AlbumScreen/song_list_tile.dart | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/components/AlbumScreen/song_list_tile.dart b/lib/components/AlbumScreen/song_list_tile.dart index eeb37d92..36d4a1da 100644 --- a/lib/components/AlbumScreen/song_list_tile.dart +++ b/lib/components/AlbumScreen/song_list_tile.dart @@ -123,7 +123,7 @@ class _SongListTileState extends ConsumerState final isCurrentlyPlaying = snapshot.data?.extras?["itemJson"]["Id"] == widget.item.id; - return TrackListItem( + final trackListItem = TrackListItem( item: widget.item, parentItem: widget.parentItem, listIndex: widget.index, @@ -228,6 +228,34 @@ class _SongListTileState extends ConsumerState } }, ); + + return isCurrentlyPlaying ? + ProviderScope( + overrides: [ + themeDataProvider.overrideWith((ref) { + return ref.watch(playerScreenThemeDataProvider) ?? + FinampTheme.defaultTheme(); + }) + ], + child: Consumer( + builder: (BuildContext context, WidgetRef ref, Widget? child) { + final imageTheme = ref.watch(playerScreenThemeProvider); + return AnimatedTheme( + duration: const Duration(milliseconds: 500), + data: ThemeData( + colorScheme: imageTheme, + brightness: Theme.of(context).brightness, + iconTheme: Theme.of(context).iconTheme.copyWith( + color: imageTheme.primary, + ), + ), + child: trackListItem, + ); + }, + ), + ) + : trackListItem; + }); void menuCallback() async { if (playable) {