Skip to content

Commit

Permalink
use current accent color to highlight playing track
Browse files Browse the repository at this point in the history
- hopefully this doesn't have a huge performance impact...
  • Loading branch information
Chaphasilor committed Jul 31, 2024
1 parent 1e9442a commit e08b22a
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion lib/components/AlbumScreen/song_list_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class _SongListTileState extends ConsumerState<SongListTile>
final isCurrentlyPlaying =
snapshot.data?.extras?["itemJson"]["Id"] == widget.item.id;

return TrackListItem(
final trackListItem = TrackListItem(
item: widget.item,
parentItem: widget.parentItem,
listIndex: widget.index,
Expand Down Expand Up @@ -228,6 +228,34 @@ class _SongListTileState extends ConsumerState<SongListTile>
}
},
);

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) {
Expand Down

0 comments on commit e08b22a

Please sign in to comment.