first commit
This commit is contained in:
80
unionflow-mobile-apps/lib/main_temp.dart
Normal file
80
unionflow-mobile-apps/lib/main_temp.dart
Normal file
@@ -0,0 +1,80 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import 'core/auth/bloc/temp_auth_bloc.dart';
|
||||
import 'core/auth/bloc/auth_event.dart';
|
||||
import 'core/auth/services/temp_auth_service.dart';
|
||||
import 'shared/theme/app_theme.dart';
|
||||
import 'app_temp.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
// Configuration du système
|
||||
await _configureApp();
|
||||
|
||||
// Lancement de l'application
|
||||
runApp(const UnionFlowTempApp());
|
||||
}
|
||||
|
||||
/// 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
|
||||
SystemChrome.setSystemUIOverlayStyle(
|
||||
const SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: Brightness.dark,
|
||||
statusBarBrightness: Brightness.light,
|
||||
systemNavigationBarColor: Colors.white,
|
||||
systemNavigationBarIconBrightness: Brightness.dark,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Application principale temporaire
|
||||
class UnionFlowTempApp extends StatelessWidget {
|
||||
const UnionFlowTempApp({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocProvider<TempAuthBloc>(
|
||||
create: (context) {
|
||||
final authService = TempAuthService();
|
||||
final authBloc = TempAuthBloc(authService);
|
||||
authBloc.add(const AuthInitializeRequested());
|
||||
return authBloc;
|
||||
},
|
||||
child: MaterialApp(
|
||||
title: 'UnionFlow',
|
||||
debugShowCheckedModeBanner: false,
|
||||
|
||||
// Configuration du thème
|
||||
theme: AppTheme.lightTheme,
|
||||
darkTheme: AppTheme.darkTheme,
|
||||
themeMode: ThemeMode.system,
|
||||
|
||||
// Configuration de la localisation
|
||||
locale: const Locale('fr', 'FR'),
|
||||
|
||||
// Application principale
|
||||
home: const AppTempWrapper(),
|
||||
|
||||
// Builder global pour gérer les erreurs
|
||||
builder: (context, child) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaler: TextScaler.linear(1.0),
|
||||
),
|
||||
child: child ?? const SizedBox(),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user