refactor: better way to determine shelf by id so localisation does not affect it

- more settings
- icons
This commit is contained in:
Dr.Blank 2025-05-22 08:10:56 +05:30
parent 2e3f4ad8d4
commit 5377398e1d
No known key found for this signature in database
GPG key ID: BA5F87FF0560C57B
10 changed files with 364 additions and 280 deletions

View file

@ -25,22 +25,15 @@ class BookHomeShelf extends HookConsumerWidget {
super.key,
required this.shelf,
required this.title,
this.showPlayButton = false,
});
final String title;
final LibraryItemShelf shelf;
final bool showPlayButton;
@override
Widget build(BuildContext context, WidgetRef ref) {
final appSettings = ref.watch(appSettingsProvider);
final homePageSettings = appSettings.homePageSettings;
final bool showPlayButton;
if (title == 'Continue Listening' || title == 'Continue Series') {
showPlayButton = homePageSettings.showPlayButtonOnContinueShelves;
} else {
showPlayButton = homePageSettings.showPlayButtonOnAllShelves;
}
return SimpleHomeShelf(
title: title,

View file

@ -15,10 +15,12 @@ class HomeShelf extends HookConsumerWidget {
super.key,
required this.shelf,
required this.title,
this.showPlayButton = false,
});
final String title;
final Shelf shelf;
final bool showPlayButton;
@override
Widget build(BuildContext context, WidgetRef ref) {
@ -26,6 +28,7 @@ class HomeShelf extends HookConsumerWidget {
ShelfType.book => BookHomeShelf(
title: title,
shelf: shelf.asLibraryItemShelf,
showPlayButton: showPlayButton,
),
ShelfType.authors => AuthorHomeShelf(
title: title,