leafittome/lib/app.dart
cschlaefke 6e22d9c3aa Projekt-Gerüst: Flutter-App mit Heute-Checkliste, Pflanzenverwaltung, Stellplätzen und Einstellungen
- Flutter/Dart (iOS + Android), Riverpod, go_router, i18n via ARB (deutsch)
- Feature-Struktur: today, plants, locations, household (V2-Platzhalter), settings
- Intervall-Modell: Aufgaben werden aus lastWatered/lastFertilized + Intervall berechnet
- In-Memory-Demo-Daten, Firebase-Anbindung folgt im nächsten Block
- Doku: Architektur, Firebase-Einrichtung, Forgejo-Git-Hosting

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 21:13:18 +02:00

44 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'core/router/app_router.dart';
import 'core/settings/settings_provider.dart';
import 'core/theme/app_theme.dart';
import 'l10n/generated/app_localizations.dart';
class PlantyApp extends ConsumerWidget {
const PlantyApp({super.key});
@override
Widget build(BuildContext context, WidgetRef ref) {
final settings = ref.watch(settingsProvider);
final router = ref.watch(appRouterProvider);
return MaterialApp.router(
routerConfig: router,
onGenerateTitle: (context) => AppLocalizations.of(context).appTitle,
theme: buildAppTheme(
brightness: Brightness.light,
highContrast: settings.highContrast,
),
darkTheme: buildAppTheme(
brightness: Brightness.dark,
highContrast: settings.highContrast,
),
themeMode: settings.themeMode,
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
builder: (context, child) {
// App-Schriftgröße wird ZUSÄTZLICH zur System-Schriftgröße angewendet,
// damit die Systemeinstellung des Nutzers respektiert bleibt.
final systemScale = MediaQuery.textScalerOf(context).scale(1.0);
return MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaler: TextScaler.linear(systemScale * settings.textSize.factor),
),
child: child!,
);
},
);
}
}