Files

34 lines
1.1 KiB
Dart
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:flutter/material.dart';
import '../services/ad_audience.dart';
import 'translation.dart';
Future<AdAudience?> chooseAdAgeGroup(BuildContext context) =>
showDialog<AdAudience>(
context: context,
builder: (context) => SimpleDialog(
title: const CopyText('Choose your age group'),
children: [
const Padding(
padding: EdgeInsets.fromLTRB(24, 0, 24, 16),
child: CopyText(
'We use this only to choose advertising settings. Under 13 and Prefer not to say play without ads. Your choice stays on this device.',
),
),
for (final option in const [
(AdAudience.under13, 'Under 13'),
(AdAudience.teen, '13–17'),
(AdAudience.adult, '18 and over'),
(AdAudience.unknown, 'Prefer not to say'),
])
SimpleDialogOption(
onPressed: () => Navigator.pop(context, option.$1),
child: CopyText(
option.$2,
style: const TextStyle(fontFamily: 'LumenText', fontSize: 18),
),
),
],
),
);