import 'package:flutter/material.dart'; import '../data/repository.dart'; import '../theme/lawheatmap_tokens.dart'; import '../widgets/lawheatmap_card.dart'; class HubStatusPage extends StatelessWidget { const HubStatusPage({super.key, required this.repository}); final EvaluationRepository repository; @override Widget build(BuildContext context) { final t = Theme.of(context).textTheme; return SingleChildScrollView( padding: const EdgeInsets.all(LawHeatmapSpace.xl), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('Ch∆In Hub', style: t.displaySmall), const SizedBox(height: LawHeatmapSpace.xs), Text( 'Status der Verbindung zum lokalen Hub und des Audit-Logs.', style: t.bodyLarge?.copyWith(color: LawHeatmapColors.mute), ), const SizedBox(height: LawHeatmapSpace.lg), LawHeatmapCard( accent: true, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ _row('Modus', repository.mode.toUpperCase(), t), _row('Quelle', repository.hubLabel, t), _row('gRPC-Endpunkt', '— (Phase-0-Stub)', t), _row('Audit-DB', '~/.chain/chain.db (geplant)', t), _row('Hash-Tag', 'CHAIN-EVENT-V3', t), ], ), ), const SizedBox(height: LawHeatmapSpace.lg), LawHeatmapCard( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text('Geplante Live-Anbindung', style: t.headlineSmall), const SizedBox(height: LawHeatmapSpace.sm), Text( '1. `chain serve` startet lokal auf Port 50051.\n' '2. Diese App liest `~/.chain/hub-auth-token` und ' 'verbindet via gRPC.\n' '3. Capability `text.akoma_normalize@^0` muss ' 'installiert sein (`chain install text.akoma_normalize`).\n' '4. Pilot-Flow `flows/durchstich-gewo-14.yaml` läuft ' 'gegen GewO §14.\n' '5. Jedes step.completed-Event landet im Audit-Log; ' 'die Repository-Implementierung tauscht von MockRepository ' 'auf HubRepository (gleiches Interface, kein UI-Wechsel).', style: t.bodyLarge?.copyWith( height: 1.6, ), ), ], ), ), ], ), ); } Widget _row(String label, String value, TextTheme t) { return Padding( padding: const EdgeInsets.symmetric(vertical: 4), child: Row( children: [ SizedBox( width: 160, child: Text(label, style: t.labelLarge ?.copyWith(color: LawHeatmapColors.mute)), ), Expanded( child: Text(value, style: t.bodyLarge ?.copyWith(fontFamily: LawHeatmapTypography.mono)), ), ], ), ); } }