Files
unionflow-mobile-apps/lib/main.dart

56 lines
1.8 KiB
Dart

/// UnionFlow - Application Mobile Révolutionnaire
///
/// Point d'entrée principal avec système d'authentification adaptatif
/// Architecture ultra-sophistiquée avec dashboard morphique basé sur les rôles
library main;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
import 'app/app.dart';
import 'core/config/environment.dart';
import 'core/l10n/locale_provider.dart';
import 'core/theme/theme_provider.dart';
import 'core/di/injection.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
AppConfig.initialize();
GoogleFonts.config.allowRuntimeFetching = !AppConfig.isProd;
// Initialisation unique et automatique (DRY)
await configureDependencies();
// Mode immersif et config système
await _configureApp();
final localeProvider = LocaleProvider();
await localeProvider.initialize();
final themeProvider = await ThemeProvider.load();
runApp(UnionFlowApp(localeProvider: localeProvider, themeProvider: themeProvider));
}
/// Configure les paramètres globaux de l'application
Future<void> _configureApp() async {
// Configuration de l'orientation
await SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
]);
// Configuration de la barre de statut - Mode immersif edge-to-edge
// Les icônes s'adaptent automatiquement via AppBarTheme.systemOverlayStyle dans chaque thème
SystemChrome.setSystemUIOverlayStyle(
const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
systemNavigationBarColor: Colors.transparent, // Transparent pour edge-to-edge
systemNavigationBarDividerColor: Colors.transparent,
),
);
// Activer le mode edge-to-edge (immersif)
SystemChrome.setEnabledSystemUIMode(
SystemUiMode.edgeToEdge,
);
}