feat(01-02): wire app.dart and main.dart for launchable app
- App widget with MaterialApp.router, theme/darkTheme from AppTheme, themeMode from ThemeNotifier - German localization delegates configured, debug banner disabled - main.dart wraps App in ProviderScope with ensureInitialized - All 16 tests pass, dart analyze clean, flutter build apk succeeds Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
27
lib/app.dart
Normal file
27
lib/app.dart
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
|
import 'package:household_keeper/core/router/router.dart';
|
||||||
|
import 'package:household_keeper/core/theme/app_theme.dart';
|
||||||
|
import 'package:household_keeper/core/theme/theme_provider.dart';
|
||||||
|
import 'package:household_keeper/l10n/app_localizations.dart';
|
||||||
|
|
||||||
|
class App extends ConsumerWidget {
|
||||||
|
const App({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
|
final themeMode = ref.watch(themeProvider);
|
||||||
|
|
||||||
|
return MaterialApp.router(
|
||||||
|
routerConfig: router,
|
||||||
|
theme: AppTheme.lightTheme(),
|
||||||
|
darkTheme: AppTheme.darkTheme(),
|
||||||
|
themeMode: themeMode,
|
||||||
|
localizationsDelegates: AppLocalizations.localizationsDelegates,
|
||||||
|
supportedLocales: const [Locale('de')],
|
||||||
|
locale: const Locale('de'),
|
||||||
|
debugShowCheckedModeBanner: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
|
import 'package:household_keeper/app.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(const ProviderScope(child: MaterialApp(home: Scaffold())));
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
runApp(const ProviderScope(child: App()));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user