update theme selection

This commit is contained in:
Phuoc Nguyen
2025-12-01 11:31:26 +07:00
parent 4ecb236532
commit 250c453413
18 changed files with 1351 additions and 304 deletions

View File

@@ -4,6 +4,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:worker/core/router/app_router.dart';
import 'package:worker/core/theme/app_theme.dart';
import 'package:worker/core/theme/theme_provider.dart';
import 'package:worker/generated/l10n/app_localizations.dart';
/// Root application widget for Worker Mobile App
@@ -22,6 +23,9 @@ class WorkerApp extends ConsumerWidget {
// Watch router provider to get auth-aware router
final router = ref.watch(routerProvider);
// Watch theme settings for dynamic theming
final themeSettings = ref.watch(themeSettingsProvider);
return MaterialApp.router(
// ==================== App Configuration ====================
debugShowCheckedModeBanner: false,
@@ -33,10 +37,10 @@ class WorkerApp extends ConsumerWidget {
routerConfig: router,
// ==================== Theme Configuration ====================
// Material 3 theme with brand colors (Primary Blue: #005B9A)
theme: AppTheme.lightTheme(),
darkTheme: AppTheme.darkTheme(),
themeMode: ThemeMode.light, // TODO: Make this configurable from settings
// Material 3 theme with dynamic seed color from settings
theme: AppTheme.lightTheme(themeSettings.seedColor),
darkTheme: AppTheme.darkTheme(themeSettings.seedColor),
themeMode: themeSettings.themeMode,
// ==================== Localization Configuration ====================
// Support for Vietnamese (primary) and English (secondary)
localizationsDelegates: const [