reclaim/app/lib/main.dart
flemming-it e08cedcd3f feat(brand): rename product to Recl∆Im (Reclaim) across app, bundle, docs
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>
2026-06-18 13:42:55 +02:00

58 lines
1.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'data/hub_endpoint.dart';
import 'data/hub_repository.dart';
import 'data/repository.dart';
import 'pages/landing_page.dart';
import 'theme/reclaim_theme.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
final settings = await HubSettings.load();
final repository = await _pickRepository(settings);
runApp(ReclaimApp(repository: repository, settings: settings));
}
/// Decide which repository to start with.
///
/// useHub=false → Mock, no probe (fast offline start)
/// useHub=true, healthy → HubRepository
/// useHub=true, NOT ok → MockRepository (graceful fallback;
/// UI banner shows hub-down so the
/// user can re-try from settings)
Future<EvaluationRepository> _pickRepository(HubSettings settings) async {
if (!settings.useHub) return const MockRepository();
final hub = await HubRepository.connect(settings);
if (hub.isHealthy) return hub;
return const MockRepository();
}
class ReclaimApp extends StatelessWidget {
const ReclaimApp({
super.key,
this.repository = const MockRepository(),
this.settings,
});
final EvaluationRepository repository;
final HubSettings? settings;
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Recl∆Im',
debugShowCheckedModeBanner: false,
theme: ReclaimTheme.light(),
darkTheme: ReclaimTheme.dark(),
themeMode: ThemeMode.dark,
localizationsDelegates: const [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
],
supportedLocales: const [Locale('de'), Locale('en')],
home: LandingPage(repository: repository),
);
}
}