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

@ -124,7 +124,7 @@ class AppSettingsPage extends HookConsumerWidget {
leading: const Icon(Icons.home_filled),
title: const Text('Home Page Settings'),
description: const Text(
'Customize the home page shelves',
'Customize the home page',
),
onPressed: (context) {
context.pushNamed(Routes.homePageSettings.name);

View file

@ -17,30 +17,79 @@ class HomePageSettingsPage extends HookConsumerWidget {
title: Text('Home Page Settings'),
sections: [
SettingsSection(
title: const Text('Quick Play'),
margin: const EdgeInsetsDirectional.symmetric(
horizontal: 16.0,
vertical: 8.0,
),
tiles: [
SettingsTile.switchTile(
title: const Text('Show play button on continue shelves'),
initialValue:
appSettings.homePageSettings.showPlayButtonOnContinueShelves,
initialValue: appSettings
.homePageSettings.showPlayButtonOnContinueListeningShelf,
title: const Text('Continue Listening'),
leading: const Icon(Icons.play_arrow),
description: const Text(
'Show play button for books in currently listening shelf',
),
onToggle: (value) {
appSettingsNotifier.update(
appSettings.copyWith(
homePageSettings: appSettings.homePageSettings.copyWith(
showPlayButtonOnContinueShelves: value,
showPlayButtonOnContinueListeningShelf: value,
),
),
);
},
),
SettingsTile.switchTile(
title: const Text('Show play button on all shelves'),
initialValue:
appSettings.homePageSettings.showPlayButtonOnAllShelves,
title: const Text('Continue Series'),
leading: const Icon(Icons.play_arrow),
description: const Text(
'Show play button for books in continue series shelf',
),
initialValue: appSettings
.homePageSettings.showPlayButtonOnContinueSeriesShelf,
onToggle: (value) {
appSettingsNotifier.update(
appSettings.copyWith(
homePageSettings: appSettings.homePageSettings.copyWith(
showPlayButtonOnAllShelves: value,
showPlayButtonOnContinueSeriesShelf: value,
),
),
);
},
),
SettingsTile.switchTile(
title: const Text('Other shelves'),
leading: const Icon(Icons.all_inclusive),
description: const Text(
'Show play button for all books in all remaining shelves',
),
initialValue: appSettings
.homePageSettings.showPlayButtonOnAllRemainingShelves,
onToggle: (value) {
appSettingsNotifier.update(
appSettings.copyWith(
homePageSettings: appSettings.homePageSettings.copyWith(
showPlayButtonOnAllRemainingShelves: value,
),
),
);
},
),
SettingsTile.switchTile(
title: const Text('Listen Again'),
leading: const Icon(Icons.replay),
description: const Text(
'Show play button for all books in listen again shelf',
),
initialValue:
appSettings.homePageSettings.showPlayButtonOnListenAgainShelf,
onToggle: (value) {
appSettingsNotifier.update(
appSettings.copyWith(
homePageSettings: appSettings.homePageSettings.copyWith(
showPlayButtonOnListenAgainShelf: value,
),
),
);