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
+4 -3
View File
@@ -120,16 +120,17 @@ class _GameScreenState extends ConsumerState<GameScreen>
final audio = ref.read(audioServiceProvider);
if (prev?.fxTick != next.fxTick && next.lastPlacement != null) {
final placement = next.lastPlacement!;
final hapticsOn = ref.read(soundEnabledProvider);
if (placement.linesCleared > 0) {
audio.play(placement.comboStreak >= 2 ? Sfx.combo : Sfx.clear);
HapticFeedback.mediumImpact();
if (hapticsOn) HapticFeedback.mediumImpact();
if (placement.comboStreak >= 4) {
HapticFeedback.heavyImpact();
if (hapticsOn) HapticFeedback.heavyImpact();
_shake.forward(from: 0);
}
} else {
audio.play(Sfx.place);
HapticFeedback.lightImpact();
if (hapticsOn) HapticFeedback.lightImpact();
}
ref.read(tutorialProvider.notifier).onPlaced();
if (placement.linesCleared > 0) {