mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-29 22:39:31 +00:00
refactor: better way to determine shelf by id so localisation does not affect it
- more settings - icons
This commit is contained in:
parent
2e3f4ad8d4
commit
5377398e1d
10 changed files with 364 additions and 280 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue