fix(ad): 스크린샷 모드에서 네이티브 광고 비활성화
This commit is contained in:
@@ -12,6 +12,7 @@ class SettingsRepositoryImpl implements SettingsRepository {
|
||||
static const String _keyNotificationDelayMinutes =
|
||||
'notification_delay_minutes';
|
||||
static const String _keyNotificationEnabled = 'notification_enabled';
|
||||
static const String _keyScreenshotModeEnabled = 'screenshot_mode_enabled';
|
||||
static const String _keyDarkModeEnabled = 'dark_mode_enabled';
|
||||
static const String _keyFirstRun = 'first_run';
|
||||
static const String _keyCategoryWeights = 'category_weights';
|
||||
@@ -22,6 +23,7 @@ class SettingsRepositoryImpl implements SettingsRepository {
|
||||
static const int _defaultMaxDistanceNormal = 1000;
|
||||
static const int _defaultNotificationDelayMinutes = 90;
|
||||
static const bool _defaultNotificationEnabled = true;
|
||||
static const bool _defaultScreenshotModeEnabled = false;
|
||||
static const bool _defaultDarkModeEnabled = false;
|
||||
static const bool _defaultFirstRun = true;
|
||||
|
||||
@@ -155,6 +157,21 @@ class SettingsRepositoryImpl implements SettingsRepository {
|
||||
await box.put(_keyNotificationEnabled, enabled);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> isScreenshotModeEnabled() async {
|
||||
final box = await _box;
|
||||
return box.get(
|
||||
_keyScreenshotModeEnabled,
|
||||
defaultValue: _defaultScreenshotModeEnabled,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> setScreenshotModeEnabled(bool enabled) async {
|
||||
final box = await _box;
|
||||
await box.put(_keyScreenshotModeEnabled, enabled);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> isDarkModeEnabled() async {
|
||||
final box = await _box;
|
||||
@@ -193,6 +210,7 @@ class SettingsRepositoryImpl implements SettingsRepository {
|
||||
_defaultNotificationDelayMinutes,
|
||||
);
|
||||
await box.put(_keyNotificationEnabled, _defaultNotificationEnabled);
|
||||
await box.put(_keyScreenshotModeEnabled, _defaultScreenshotModeEnabled);
|
||||
await box.put(_keyDarkModeEnabled, _defaultDarkModeEnabled);
|
||||
await box.put(_keyFirstRun, false); // 리셋 후에는 첫 실행이 아님
|
||||
}
|
||||
@@ -215,6 +233,7 @@ class SettingsRepositoryImpl implements SettingsRepository {
|
||||
_keyMaxDistanceNormal: await getMaxDistanceNormal(),
|
||||
_keyNotificationDelayMinutes: await getNotificationDelayMinutes(),
|
||||
_keyNotificationEnabled: await isNotificationEnabled(),
|
||||
_keyScreenshotModeEnabled: await isScreenshotModeEnabled(),
|
||||
_keyDarkModeEnabled: await isDarkModeEnabled(),
|
||||
_keyFirstRun: await isFirstRun(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user