feat(settings): soundEnabled provider gates SFX and haptics

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-13 17:59:08 +09:00
parent 93397988a2
commit 3ca038ec65
4 changed files with 48 additions and 4 deletions
+17
View File
@@ -0,0 +1,17 @@
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'providers.dart';
/// SFX + gameplay haptics on/off, seeded from the save repository.
class SoundEnabledNotifier extends Notifier<bool> {
@override
bool build() => ref.read(saveRepositoryProvider).soundEnabled;
Future<void> toggle() => set(!state);
Future<void> set(bool value) async {
if (state == value) return;
await ref.read(saveRepositoryProvider).setSoundEnabled(value);
state = value;
}
}