This commit is contained in:
Phuoc Nguyen
2025-10-17 18:06:32 +07:00
parent 57bf73e4d1
commit e321e9a419
6 changed files with 445 additions and 231 deletions

View File

@@ -2,8 +2,8 @@ import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
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/features/home/presentation/pages/home_page.dart';
import 'package:worker/generated/l10n/app_localizations.dart';
/// Root application widget for Worker Mobile App
@@ -19,11 +19,15 @@ class WorkerApp extends ConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
return MaterialApp(
return MaterialApp.router(
// ==================== App Configuration ====================
debugShowCheckedModeBanner: false,
title: 'Worker App',
// ==================== Router Configuration ====================
// Using go_router for declarative routing with deep linking support
routerConfig: AppRouter.router,
// ==================== Theme Configuration ====================
// Material 3 theme with brand colors (Primary Blue: #005B9A)
theme: AppTheme.lightTheme(),
@@ -64,21 +68,6 @@ class WorkerApp extends ConsumerWidget {
return const Locale('vi', 'VN');
},
// ==================== Navigation Configuration ====================
// TODO: Replace with actual router configuration when navigation is implemented
// Options:
// 1. Use go_router for declarative routing
// 2. Use Navigator 2.0 for imperative routing
// 3. Use auto_route for type-safe routing
//
// For now, we show the home screen directly
home: const HomePage(),
// Alternative: Use onGenerateRoute for custom routing
// onGenerateRoute: (settings) {
// return AppRouter.onGenerateRoute(settings);
// },
// ==================== Material App Configuration ====================
// Builder for additional context-dependent widgets
builder: (context, child) {