2025-05-22 00:44:06 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
2025-05-22 06:43:46 +05:30
|
|
|
import 'package:flutter_settings_ui/flutter_settings_ui.dart';
|
2025-05-22 00:44:06 +00:00
|
|
|
import 'package:vaani/settings/app_settings_provider.dart';
|
2025-05-22 06:43:46 +05:30
|
|
|
import 'package:vaani/settings/view/simple_settings_page.dart'
|
|
|
|
|
show SimpleSettingsPage;
|
2025-05-22 00:44:06 +00:00
|
|
|
|
|
|
|
|
class HomePageSettingsPage extends HookConsumerWidget {
|
|
|
|
|
const HomePageSettingsPage({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
|
|
|
final appSettings = ref.watch(appSettingsProvider);
|
|
|
|
|
final appSettingsNotifier = ref.read(appSettingsProvider.notifier);
|
|
|
|
|
|
|
|
|
|
return SimpleSettingsPage(
|
2025-05-22 06:43:46 +05:30
|
|
|
title: Text('Home Page Settings'),
|
|
|
|
|
sections: [
|
|
|
|
|
SettingsSection(
|
|
|
|
|
tiles: [
|
|
|
|
|
SettingsTile.switchTile(
|
|
|
|
|
title: const Text('Show play button on continue shelves'),
|
|
|
|
|
initialValue:
|
|
|
|
|
appSettings.homePageSettings.showPlayButtonOnContinueShelves,
|
|
|
|
|
onToggle: (value) {
|
|
|
|
|
appSettingsNotifier.update(
|
|
|
|
|
appSettings.copyWith(
|
|
|
|
|
homePageSettings: appSettings.homePageSettings.copyWith(
|
|
|
|
|
showPlayButtonOnContinueShelves: value,
|
2025-05-22 00:44:06 +00:00
|
|
|
),
|
2025-05-22 06:43:46 +05:30
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
SettingsTile.switchTile(
|
|
|
|
|
title: const Text('Show play button on all shelves'),
|
|
|
|
|
initialValue:
|
|
|
|
|
appSettings.homePageSettings.showPlayButtonOnAllShelves,
|
|
|
|
|
onToggle: (value) {
|
|
|
|
|
appSettingsNotifier.update(
|
|
|
|
|
appSettings.copyWith(
|
|
|
|
|
homePageSettings: appSettings.homePageSettings.copyWith(
|
|
|
|
|
showPlayButtonOnAllShelves: value,
|
2025-05-22 00:44:06 +00:00
|
|
|
),
|
2025-05-22 06:43:46 +05:30
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
2025-05-22 00:44:06 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|