Recl∆Im — the F∆I product line for Pflicht-basierte
Wirkungsanalyse und Reform-Vorschlags-Pipelines. Replaces the
working title 'Law-Heatmap', which described the demo view
rather than the platform. Heatmap, Norms list, Hub view,
Methodik are now four panes of the same Recl∆Im app.
Renames in this commit:
Flutter package lawheatmap_app -> reclaim_app
macOS bundle id ai.flemming.lawheatmapApp -> ai.flemming.reclaim
macOS PRODUCT_NAME lawheatmap_app -> reclaim_app
Theme tokens LawHeatmapColors/Space/Radius/Typography/Theme
-> Reclaim*
Surface card LawHeatmapCard -> ReclaimCard
Top-level widget LawHeatmapApp -> ReclaimApp
Theme files lawheatmap_theme.dart/lawheatmap_tokens.dart
-> reclaim_theme.dart/reclaim_tokens.dart
Widget file lawheatmap_card.dart -> reclaim_card.dart
Build script build-macos.sh paths and headline string
Docs MACHBARKEITSSTUDIE.md, METHODIK.md, RUN.md,
app/README.md, flow YAML
UI strings 'F∆I Law-Heatmap' / 'Law-Heatmap'
-> 'Recl∆Im' / 'Recl∆Im (F∆I)' for vendor-
prefixed contexts
flutter analyze: clean. flutter test: 2/2 passing.
The local working directory stays fai_lawheatmap/ for now —
the dir is referenced by the .claude project metadata; renaming
it would break session continuity for no real gain. The Forgejo
repo was renamed via API in the same change-set (fai/lawheatmap
-> fai/reclaim), with the legacy slug serving a redirect
courtesy of Forgejo's built-in rename handling.
Signed-off-by: flemming-it <sf@flemming.it>
176 lines
5.3 KiB
Dart
176 lines
5.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../data/models.dart';
|
|
import '../data/repository.dart';
|
|
import '../theme/reclaim_tokens.dart';
|
|
import '../widgets/demo_banner.dart';
|
|
import '../widgets/reclaim_card.dart';
|
|
import '../widgets/tier_badge.dart';
|
|
import 'norm_detail_page.dart';
|
|
|
|
class NormsListPage extends StatelessWidget {
|
|
const NormsListPage({super.key, required this.repository});
|
|
|
|
final EvaluationRepository repository;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final t = Theme.of(context).textTheme;
|
|
return Column(
|
|
children: [
|
|
const DemoBanner(),
|
|
Expanded(
|
|
child: SingleChildScrollView(
|
|
padding: const EdgeInsets.all(ReclaimSpace.xl),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text('Normen-Pilotkorpus', style: t.displaySmall),
|
|
const SizedBox(height: ReclaimSpace.xs),
|
|
Text(
|
|
'5 Normen für den vertikalen Durchstich. '
|
|
'Korpus erweiterbar in Phase 1.',
|
|
style: t.bodyLarge?.copyWith(
|
|
color: ReclaimColors.mute,
|
|
),
|
|
),
|
|
const SizedBox(height: ReclaimSpace.lg),
|
|
FutureBuilder<List<Evaluation>>(
|
|
future: repository.list(),
|
|
builder: (context, snap) {
|
|
if (!snap.hasData) {
|
|
return const Center(
|
|
child: CircularProgressIndicator());
|
|
}
|
|
return Column(
|
|
children: [
|
|
for (final e in snap.data!)
|
|
Padding(
|
|
padding: const EdgeInsets.only(
|
|
bottom: ReclaimSpace.md),
|
|
child: _NormRow(
|
|
evaluation: e,
|
|
repository: repository,
|
|
),
|
|
),
|
|
],
|
|
);
|
|
},
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|
|
|
|
class _NormRow extends StatelessWidget {
|
|
const _NormRow({required this.evaluation, required this.repository});
|
|
|
|
final Evaluation evaluation;
|
|
final EvaluationRepository repository;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final t = Theme.of(context).textTheme;
|
|
return InkWell(
|
|
onTap: () {
|
|
Navigator.of(context).push(
|
|
MaterialPageRoute(
|
|
builder: (_) => NormDetailPage(
|
|
repository: repository,
|
|
evaluation: evaluation,
|
|
),
|
|
),
|
|
);
|
|
},
|
|
child: ReclaimCard(
|
|
child: Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Expanded(
|
|
flex: 4,
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
'${evaluation.norm.jurabk} ${evaluation.norm.paragraph} — ${evaluation.norm.title}',
|
|
style: t.titleMedium,
|
|
),
|
|
const SizedBox(height: 4),
|
|
Text(
|
|
evaluation.norm.eli,
|
|
style: t.labelSmall?.copyWith(
|
|
fontFamily: ReclaimTypography.mono,
|
|
color: ReclaimColors.mute,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
const SizedBox(width: ReclaimSpace.lg),
|
|
Expanded(
|
|
child: _MetricColumn(
|
|
label: 'Schaden / Jahr',
|
|
value: _eur(evaluation.skmEurPerYear),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: _MetricColumn(
|
|
label: 'Nutzen',
|
|
value:
|
|
'${evaluation.benefitScore.toStringAsFixed(1)} / 5',
|
|
),
|
|
),
|
|
Expanded(
|
|
child: _MetricColumn(
|
|
label: 'Betroffene',
|
|
value: _kmu(evaluation.affectedCount),
|
|
),
|
|
),
|
|
const SizedBox(width: ReclaimSpace.md),
|
|
TierBadge(tier: evaluation.tierLowest),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
String _eur(double v) {
|
|
if (v >= 1e9) return '${(v / 1e9).toStringAsFixed(2)} Mrd €';
|
|
if (v >= 1e6) return '${(v / 1e6).toStringAsFixed(1)} Mio €';
|
|
if (v >= 1e3) return '${(v / 1e3).toStringAsFixed(0)} k €';
|
|
return '${v.toStringAsFixed(0)} €';
|
|
}
|
|
|
|
String _kmu(int n) {
|
|
if (n >= 1_000_000) return '${(n / 1e6).toStringAsFixed(1)} Mio';
|
|
if (n >= 1_000) return '${(n / 1e3).toStringAsFixed(0)} k';
|
|
return n.toString();
|
|
}
|
|
}
|
|
|
|
class _MetricColumn extends StatelessWidget {
|
|
const _MetricColumn({required this.label, required this.value});
|
|
|
|
final String label;
|
|
final String value;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final t = Theme.of(context).textTheme;
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(
|
|
label,
|
|
style: t.labelSmall?.copyWith(color: ReclaimColors.mute),
|
|
),
|
|
const SizedBox(height: 2),
|
|
Text(value, style: t.titleMedium),
|
|
],
|
|
);
|
|
}
|
|
}
|