app/lib/screens/welcome_screen.dart
John Mizerek 247388c61a Add Skip Forever, app icon, About screen links, release signing
- Add Skip/Skip Forever links to onboarding screens only
- Remove Skip links from questionnaire screens (baseline, behavioral, lifestyle)
- Add app icon (1024x1024) and generate all platform sizes
- Update About screen with correct URLs (privacy, terms, disclaimer, how it works)
- Add "No ads. Ever." section to About screen
- Configure Android release signing with upload keystore
- Add URL intent query for Android 11+ link launching
- Add skipForever preference to LocalStorage

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-21 13:21:17 -08:00

130 lines
4.2 KiB
Dart

import 'package:flutter/material.dart';
import '../storage/local_storage.dart';
import '../theme.dart';
import 'about_screen.dart';
import 'baseline_screen.dart';
class WelcomeScreen extends StatelessWidget {
const WelcomeScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
child: Column(
children: [
const Spacer(flex: 1),
// Main question - large and centered
Text(
'Simple questions.\nHonest answers.',
style: Theme.of(context).textTheme.headlineLarge?.copyWith(
fontSize: 32,
height: 1.3,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 40),
Text(
"What's the single biggest change I can make to live a longer, healthier life?",
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w400,
color: AppColors.textSecondary,
height: 1.4,
),
textAlign: TextAlign.center,
),
const Spacer(flex: 2),
// Privacy note
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
Icons.lock_outline,
size: 16,
color: AppColors.textSecondary,
),
const SizedBox(width: 8),
Text(
'All data stays on your device',
style: Theme.of(context).textTheme.bodySmall,
),
],
),
const SizedBox(height: 24),
// Start button
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () => _navigateToBaseline(context),
child: const Text('Start'),
),
),
const SizedBox(height: 16),
// Skip Forever and About links
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
onPressed: () => _showSkipForeverConfirmation(context),
child: const Text('Skip Forever'),
),
const SizedBox(width: 24),
TextButton(
onPressed: () => Navigator.push(
context,
MaterialPageRoute(builder: (_) => const AboutScreen()),
),
child: const Text('About'),
),
],
),
const SizedBox(height: 16),
],
),
),
),
);
}
void _navigateToBaseline(BuildContext context) {
Navigator.of(context).push(
MaterialPageRoute(builder: (_) => const BaselineScreen()),
);
}
void _showSkipForeverConfirmation(BuildContext context) {
showDialog(
context: context,
builder: (dialogContext) => AlertDialog(
title: const Text('Skip Forever?'),
content: const Text(
'You won\'t be asked to complete the questionnaire again. '
'You can still access the app from the About screen.',
),
actions: [
TextButton(
onPressed: () => Navigator.pop(dialogContext),
child: const Text('Cancel'),
),
TextButton(
onPressed: () async {
await LocalStorage.setSkipForever(true);
Navigator.pop(dialogContext);
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Questionnaire skipped'),
duration: Duration(seconds: 2),
),
);
}
},
child: const Text('Skip Forever'),
),
],
),
);
}
}