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
+6 -1
View File
@@ -11,6 +11,7 @@ import '../services/consent_service.dart';
import '../services/iap_service.dart';
import 'ads_notifier.dart';
import 'endless_best_notifier.dart';
import 'sound_notifier.dart';
import 'game_session_notifier.dart';
import 'progress_notifier.dart';
import 'season_flow_notifier.dart';
@@ -22,8 +23,12 @@ final gameSessionProvider =
GameSessionNotifier.new,
);
final soundEnabledProvider =
NotifierProvider<SoundEnabledNotifier, bool>(SoundEnabledNotifier.new);
final audioServiceProvider = Provider<AudioService>((ref) {
final service = AudioService();
final service = AudioService(enabled: ref.read(soundEnabledProvider));
ref.listen<bool>(soundEnabledProvider, (_, next) => service.enabled = next);
ref.onDispose(service.dispose);
return service;
});