fix(ad): 스크린샷 모드에서 네이티브 광고 비활성화

This commit is contained in:
JiWoong Sul
2025-12-04 16:29:32 +09:00
parent 04b1c3e987
commit bcc26f5e79
11 changed files with 1037 additions and 230 deletions

View File

@@ -54,6 +54,10 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
@override
Widget build(BuildContext context) {
final isDark = Theme.of(context).brightness == Brightness.dark;
final screenshotModeAsync = ref.watch(screenshotModeEnabledProvider);
final screenshotModeEnabled = screenshotModeAsync.valueOrNull ?? false;
final isUpdatingSettings = ref.watch(settingsNotifierProvider).isLoading;
final showScreenshotTools = !kReleaseMode;
return Scaffold(
backgroundColor: isDark
@@ -350,6 +354,29 @@ class _SettingsScreenState extends ConsumerState<SettingsScreen> {
],
),
),
if (showScreenshotTools)
Card(
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
color: isDark ? AppColors.darkSurface : AppColors.lightSurface,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
child: SwitchListTile.adaptive(
title: const Text('스크린샷 모드'),
subtitle: const Text('네이티브 광고를 숨기고 가상의 추천 결과를 표시합니다'),
value: screenshotModeEnabled,
onChanged:
(isUpdatingSettings || screenshotModeAsync.isLoading)
? null
: (value) async {
await ref
.read(settingsNotifierProvider.notifier)
.setScreenshotModeEnabled(value);
ref.invalidate(screenshotModeEnabledProvider);
},
activeColor: AppColors.lightPrimary,
),
),
if (kDebugMode) _buildDebugToolsCard(isDark),
], isDark),