import 'package:shared_preferences/shared_preferences.dart'; class SettingsManager { static const String _keyMusicEnabled = 'music_enabled'; static const String _keyHapticsEnabled = 'haptics_enabled'; static const String _keyTutorialShown = 'tutorial_shown'; static SharedPreferences? _prefs; static Future init() async { _prefs = await SharedPreferences.getInstance(); } // Music Settings static bool get isMusicEnabled => _prefs?.getBool(_keyMusicEnabled) ?? true; static Future setMusicEnabled(bool enabled) async { await _prefs?.setBool(_keyMusicEnabled, enabled); } // Haptics Settings static bool get isHapticsEnabled => _prefs?.getBool(_keyHapticsEnabled) ?? true; static Future setHapticsEnabled(bool enabled) async { await _prefs?.setBool(_keyHapticsEnabled, enabled); } // Tutorial Settings static bool get isTutorialShown => _prefs?.getBool(_keyTutorialShown) ?? false; static Future setTutorialShown(bool shown) async { await _prefs?.setBool(_keyTutorialShown, shown); } }