| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323 |
- import 'package:flutter/material.dart';
- import 'package:go_router/go_router.dart';
- class HomePage extends StatelessWidget {
- const HomePage({super.key});
- @override
- Widget build(BuildContext context) {
- final theme = Theme.of(context);
- return Scaffold(
- body: DecoratedBox(
- decoration: const BoxDecoration(
- gradient: LinearGradient(
- begin: Alignment.topLeft,
- end: Alignment.bottomRight,
- colors: [Color(0xFFF3EDE0), Color(0xFFE9E0CF), Color(0xFFDDE8E0)],
- ),
- ),
- child: SafeArea(
- child: ListView(
- padding: const EdgeInsets.fromLTRB(20, 16, 20, 24),
- children: [
- Text(
- 'TC Mobile Lab',
- style: theme.textTheme.titleMedium?.copyWith(
- color: theme.colorScheme.primary,
- letterSpacing: 0.6,
- ),
- ),
- const SizedBox(height: 10),
- Text(
- 'Audio tricorder for structured signal analysis.',
- style: theme.textTheme.displaySmall,
- ),
- const SizedBox(height: 12),
- Text(
- 'Record a sample, let the probe chain inspect it, then hand the evidence to the AI analyst for hypothesis, validation, and conclusion.',
- style: theme.textTheme.bodyLarge,
- ),
- const SizedBox(height: 24),
- Card(
- child: Padding(
- padding: const EdgeInsets.all(22),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- 'Quick Start',
- style: theme.textTheme.headlineMedium,
- ),
- const SizedBox(height: 12),
- _SignalChip(
- label: 'Local probe chain',
- tone: theme.colorScheme.secondary,
- ),
- const SizedBox(height: 10),
- _SignalChip(
- label: 'Remote AI analyst',
- tone: theme.colorScheme.tertiary,
- ),
- const SizedBox(height: 18),
- Row(
- children: [
- Expanded(
- child: FilledButton(
- onPressed: () => context.goNamed('capture'),
- child: const Text('Start Recording'),
- ),
- ),
- const SizedBox(width: 12),
- Expanded(
- child: OutlinedButton(
- onPressed: () => context.goNamed('observation'),
- child: const Text('Import Sample'),
- ),
- ),
- ],
- ),
- ],
- ),
- ),
- ),
- const SizedBox(height: 18),
- Row(
- children: [
- Expanded(
- child: _StatusCard(
- title: 'Current Mode',
- value: 'Idle',
- note: 'Ready for local probe',
- accent: theme.colorScheme.primary,
- ),
- ),
- const SizedBox(width: 14),
- Expanded(
- child: _StatusCard(
- title: 'Pipeline',
- value: 'Probe',
- note: 'No active experiment',
- accent: theme.colorScheme.secondary,
- ),
- ),
- ],
- ),
- const SizedBox(height: 18),
- Card(
- child: Padding(
- padding: const EdgeInsets.all(22),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('Lab Sections', style: theme.textTheme.titleLarge),
- const SizedBox(height: 14),
- Wrap(
- spacing: 10,
- runSpacing: 10,
- children: [
- _NavChip(
- label: 'Observation',
- onTap: () => context.goNamed('observation'),
- ),
- _NavChip(
- label: 'Experiment',
- onTap: () => context.goNamed('experiment'),
- ),
- _NavChip(
- label: 'Conclusion',
- onTap: () => context.goNamed('conclusion'),
- ),
- _NavChip(
- label: 'History',
- onTap: () => context.goNamed('history'),
- ),
- _NavChip(
- label: 'Settings',
- onTap: () => context.goNamed('settings'),
- ),
- ],
- ),
- ],
- ),
- ),
- ),
- const SizedBox(height: 18),
- Card(
- child: Padding(
- padding: const EdgeInsets.all(22),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('First MVP flow', style: theme.textTheme.titleLarge),
- const SizedBox(height: 16),
- const _FlowStep(
- index: '01',
- title: 'Capture Observation',
- body:
- 'Record or import audio and store the observation metadata.',
- ),
- const _FlowStep(
- index: '02',
- title: 'Run Probe Chain',
- body:
- 'Generate onset, spectral, and periodicity evidence on device.',
- ),
- const _FlowStep(
- index: '03',
- title: 'Ask AI Analyst',
- body:
- 'Send structured evidence for hypothesis and experiment planning.',
- ),
- const _FlowStep(
- index: '04',
- title: 'Review Conclusion',
- body:
- 'Inspect findings, contradictions, and next-step suggestions.',
- ),
- ],
- ),
- ),
- ),
- ],
- ),
- ),
- ),
- );
- }
- }
- class _NavChip extends StatelessWidget {
- const _NavChip({required this.label, required this.onTap});
- final String label;
- final VoidCallback onTap;
- @override
- Widget build(BuildContext context) {
- return ActionChip(
- label: Text(label),
- onPressed: onTap,
- avatar: const Icon(Icons.arrow_outward, size: 18),
- );
- }
- }
- class _StatusCard extends StatelessWidget {
- const _StatusCard({
- required this.title,
- required this.value,
- required this.note,
- required this.accent,
- });
- final String title;
- final String value;
- final String note;
- final Color accent;
- @override
- Widget build(BuildContext context) {
- final theme = Theme.of(context);
- return Card(
- child: Padding(
- padding: const EdgeInsets.all(18),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- width: 14,
- height: 14,
- decoration: BoxDecoration(
- color: accent,
- borderRadius: BorderRadius.circular(999),
- ),
- ),
- const SizedBox(height: 12),
- Text(title, style: theme.textTheme.titleMedium),
- const SizedBox(height: 6),
- Text(value, style: theme.textTheme.headlineMedium),
- const SizedBox(height: 6),
- Text(note, style: theme.textTheme.bodyMedium),
- ],
- ),
- ),
- );
- }
- }
- class _SignalChip extends StatelessWidget {
- const _SignalChip({required this.label, required this.tone});
- final String label;
- final Color tone;
- @override
- Widget build(BuildContext context) {
- return Container(
- padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
- decoration: BoxDecoration(
- color: tone.withValues(alpha: 0.12),
- borderRadius: BorderRadius.circular(999),
- ),
- child: Text(
- label,
- style: Theme.of(context).textTheme.titleMedium?.copyWith(color: tone),
- ),
- );
- }
- }
- class _FlowStep extends StatelessWidget {
- const _FlowStep({
- required this.index,
- required this.title,
- required this.body,
- });
- final String index;
- final String title;
- final String body;
- @override
- Widget build(BuildContext context) {
- final theme = Theme.of(context);
- return Padding(
- padding: const EdgeInsets.only(bottom: 16),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- width: 44,
- height: 44,
- alignment: Alignment.center,
- decoration: BoxDecoration(
- color: theme.colorScheme.primary,
- borderRadius: BorderRadius.circular(16),
- ),
- child: Text(
- index,
- style: theme.textTheme.titleMedium?.copyWith(color: Colors.white),
- ),
- ),
- const SizedBox(width: 14),
- Expanded(
- child: Padding(
- padding: const EdgeInsets.only(top: 2),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(title, style: theme.textTheme.titleMedium),
- const SizedBox(height: 4),
- Text(body, style: theme.textTheme.bodyMedium),
- ],
- ),
- ),
- ),
- ],
- ),
- );
- }
- }
|