Clean project: remove test files, debug logs, and add documentation
This commit is contained in:
@@ -8,11 +8,15 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'core/design_system/theme/app_theme_sophisticated.dart';
|
||||
import 'core/auth/bloc/auth_bloc.dart';
|
||||
import 'core/cache/dashboard_cache_manager.dart';
|
||||
import 'core/l10n/locale_provider.dart';
|
||||
import 'features/auth/presentation/pages/login_page.dart';
|
||||
import 'core/navigation/main_navigation_layout.dart';
|
||||
import 'core/di/app_di.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
@@ -20,10 +24,17 @@ void main() async {
|
||||
// Configuration du système
|
||||
await _configureApp();
|
||||
|
||||
// Initialisation de l'injection de dépendances
|
||||
await AppDI.initialize();
|
||||
|
||||
// Initialisation du cache
|
||||
await DashboardCacheManager.initialize();
|
||||
|
||||
runApp(const UnionFlowApp());
|
||||
// Initialisation du LocaleProvider
|
||||
final localeProvider = LocaleProvider();
|
||||
await localeProvider.initialize();
|
||||
|
||||
runApp(UnionFlowApp(localeProvider: localeProvider));
|
||||
}
|
||||
|
||||
/// Configure les paramètres globaux de l'application
|
||||
@@ -47,32 +58,39 @@ Future<void> _configureApp() async {
|
||||
|
||||
/// Application principale avec système d'authentification Keycloak
|
||||
class UnionFlowApp extends StatelessWidget {
|
||||
const UnionFlowApp({super.key});
|
||||
final LocaleProvider localeProvider;
|
||||
|
||||
const UnionFlowApp({super.key, required this.localeProvider});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider(
|
||||
create: (context) => AuthBloc()..add(const AuthStatusChecked()),
|
||||
child: MaterialApp(
|
||||
title: 'UnionFlow',
|
||||
debugShowCheckedModeBanner: false,
|
||||
return MultiProvider(
|
||||
providers: [
|
||||
ChangeNotifierProvider.value(value: localeProvider),
|
||||
BlocProvider(
|
||||
create: (context) => AuthBloc()..add(const AuthStatusChecked()),
|
||||
),
|
||||
],
|
||||
child: Consumer<LocaleProvider>(
|
||||
builder: (context, localeProvider, child) {
|
||||
return MaterialApp(
|
||||
title: 'UnionFlow',
|
||||
debugShowCheckedModeBanner: false,
|
||||
|
||||
// Configuration du thème
|
||||
theme: AppThemeSophisticated.lightTheme,
|
||||
// darkTheme: AppThemeSophisticated.darkTheme,
|
||||
// themeMode: ThemeMode.system,
|
||||
// Configuration du thème
|
||||
theme: AppThemeSophisticated.lightTheme,
|
||||
// darkTheme: AppThemeSophisticated.darkTheme,
|
||||
// themeMode: ThemeMode.system,
|
||||
|
||||
// Configuration de la localisation
|
||||
locale: const Locale('fr', 'FR'),
|
||||
supportedLocales: const [
|
||||
Locale('fr', 'FR'), // Français
|
||||
Locale('en', 'US'), // Anglais
|
||||
],
|
||||
localizationsDelegates: const [
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
// Configuration de la localisation
|
||||
locale: localeProvider.locale,
|
||||
supportedLocales: LocaleProvider.supportedLocales,
|
||||
localizationsDelegates: const [
|
||||
AppLocalizations.delegate,
|
||||
GlobalMaterialLocalizations.delegate,
|
||||
GlobalWidgetsLocalizations.delegate,
|
||||
GlobalCupertinoLocalizations.delegate,
|
||||
],
|
||||
|
||||
// Configuration des routes
|
||||
routes: {
|
||||
@@ -98,13 +116,15 @@ class UnionFlowApp extends StatelessWidget {
|
||||
// Page d'accueil par défaut
|
||||
initialRoute: '/',
|
||||
|
||||
// Builder global pour gérer les erreurs
|
||||
builder: (context, child) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaler: const TextScaler.linear(1.0),
|
||||
),
|
||||
child: child ?? const SizedBox(),
|
||||
// Builder global pour gérer les erreurs
|
||||
builder: (context, child) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaler: const TextScaler.linear(1.0),
|
||||
),
|
||||
child: child ?? const SizedBox(),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user