import 'package:flutter/foundation.dart'; import 'persisted_setting.dart'; class AppSpectrumBackground { static const prefKey = 'app_spectrum_background'; static const bool defaultValue = false; static final _setting = PersistedSetting( prefKey: prefKey, defaultValue: defaultValue, read: (prefs, key) => prefs.getBool(key), write: (prefs, key, value) async { await prefs.setBool(key, value); }, ); static ValueNotifier get current => _setting.current; static bool get isEnabled => _setting.current.value; static Future load() => _setting.load(); static Future save(bool value) => _setting.save(value); }