app/lib/screens/welcome_screen.dart
John Mizerek 85e8e1a290 Add saved runs feature with history, comparison, and about screen (v1.2)
Features:
- Save calculation runs with custom labels for later retrieval
- View saved runs list with dominant factor summary
- View detailed results of any saved run
- View original inputs in read-only mode
- Use any saved run as starting point for new calculation
- Compare two saved runs side-by-side
- About screen with app info, help links, privacy policy
- Metric/Imperial unit toggle persisted across sessions
- Info icon in app bar on all screens

Technical:
- New SavedRun model with full serialization
- SQLite saved_runs table with CRUD operations
- readOnly mode for all input screens
- Unit preference stored in LocalStorage
- Database schema upgraded to v2

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

85 lines
2.7 KiB
Dart

import 'package:flutter/material.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),
// About link
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()),
);
}
}