Prepare Google Play release with age-gated ads and store assets

This commit is contained in:
Hadrian Burkhardt
2026-11-15 18:54:43 +01:00
parent d73c5fc89a
commit 57b8bc20b8
49 changed files with 836 additions and 82 deletions
+23
View File
@@ -0,0 +1,23 @@
/// Broad age groups used only to choose advertising settings.
///
/// Only this choice is stored locally; no birth date is collected. Players who
/// choose [under13] or [unknown] play without advertising, and the ad SDK is
/// never initialized for them.
enum AdAudience {
unknown,
under13,
teen,
adult;
/// The only age information the app persists.
static const storageKey = 'ad_age_group_v1';
bool get allowsAds => this == teen || this == adult;
/// Teens, under-13s and unknown-age players never receive standard adult
/// advertising treatment.
bool get restricted => this != adult;
static AdAudience fromStored(String value) =>
values.where((group) => group.name == value).firstOrNull ?? unknown;
}