The landing CTA hard-coded 'Demo-Modus' and 'Live-Hub-Anbindung folgt in Woche 1' — stale now that live mode is the default and works. CTA is just 'App öffnen'; the subtitle + version line read the resolved repository.mode (Live-Hub / Hub offline / Demo-Modus). Verified in-browser: opening the app fires 5 Submit RPCs (200) for the 5 live norms over gRPC-web. Signed-off-by: flemming-it <sf@flemming.it>
107 lines
3.9 KiB
Dart
107 lines
3.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../data/repository.dart';
|
|
import '../theme/reclaim_theme.dart';
|
|
import '../theme/reclaim_tokens.dart';
|
|
import '../widgets/brand_wordmark.dart';
|
|
import '../widgets/delta_mark.dart';
|
|
import 'shell_page.dart';
|
|
|
|
/// First-run landing: brand mark, one-line claim, "enter app" CTA.
|
|
/// The CTA carries the resolved [repository] (live hub by default,
|
|
/// demo when the Hub-Reiter opts out) — the subtitle reflects which.
|
|
class LandingPage extends StatelessWidget {
|
|
const LandingPage({super.key, required this.repository});
|
|
|
|
final EvaluationRepository repository;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final t = Theme.of(context).textTheme;
|
|
final live = repository.mode == 'hub-live';
|
|
final down = repository.mode == 'hub-down';
|
|
final modeLabel = live
|
|
? 'Live-Hub'
|
|
: down
|
|
? 'Hub offline'
|
|
: 'Demo-Modus';
|
|
final subtitle = live
|
|
? '5 Pilot-Normen, live aus dem Hub ausgewertet'
|
|
: down
|
|
? 'Hub nicht erreichbar — im Hub-Reiter auf Demo umschalten'
|
|
: 'Demo: 5 Pilot-Normen, ohne Hub-Verbindung';
|
|
return Scaffold(
|
|
body: SafeArea(
|
|
child: Center(
|
|
child: ConstrainedBox(
|
|
constraints: const BoxConstraints(maxWidth: 820),
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: ReclaimSpace.xxl,
|
|
vertical: ReclaimSpace.xxxl,
|
|
),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const Row(
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
DeltaMark(size: 96),
|
|
SizedBox(width: ReclaimSpace.xl),
|
|
BrandWordmark(
|
|
size: 56,
|
|
letterSpacing: -1.0,
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: ReclaimSpace.xl),
|
|
const SizedBox(height: ReclaimSpace.sm),
|
|
Text(
|
|
'Pflicht-basierte Wirkungsanalyse von Rechtsnormen — '
|
|
'auf Ch∆In, mit Quellen-Audit by construction.',
|
|
style: t.bodyLarge
|
|
?.copyWith(color: ReclaimColors.mute),
|
|
),
|
|
const SizedBox(height: ReclaimSpace.xxl),
|
|
Wrap(
|
|
crossAxisAlignment: WrapCrossAlignment.center,
|
|
spacing: ReclaimSpace.md,
|
|
runSpacing: ReclaimSpace.sm,
|
|
children: [
|
|
FilledButton.icon(
|
|
onPressed: () {
|
|
Navigator.of(context).pushReplacement(
|
|
MaterialPageRoute(
|
|
builder: (_) =>
|
|
ShellPage(repository: repository),
|
|
),
|
|
);
|
|
},
|
|
icon: const Icon(Icons.east),
|
|
label: const Text('App öffnen'),
|
|
),
|
|
Text(
|
|
subtitle,
|
|
style: t.labelSmall?.copyWith(
|
|
color: ReclaimColors.mute,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: ReclaimSpace.xl),
|
|
Text(
|
|
'v0.1.0 · Phase 0 · $modeLabel',
|
|
style: ReclaimTheme.mono(
|
|
t.labelSmall ?? const TextStyle(),
|
|
).copyWith(color: ReclaimColors.mute),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|