Prepare Google Play release with age-gated ads and store assets
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user