mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-01-07 02:39:32 +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
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue