You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							45 lines
						
					
					
						
							1.5 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							45 lines
						
					
					
						
							1.5 KiB
						
					
					
				| import 'package:flutter/material.dart'; | |
| import 'package:flutter_localizations/flutter_localizations.dart'; | |
| import 'package:hadi_hoda_flutter/common_ui/theme/my_theme.dart'; | |
| import 'package:hadi_hoda_flutter/common_ui/theme/theme_service.dart'; | |
| import 'package:hadi_hoda_flutter/core/routers/my_routes.dart'; | |
| import 'package:hadi_hoda_flutter/core/utils/local_storage.dart'; | |
| import 'package:hadi_hoda_flutter/core/utils/my_device.dart'; | |
| import 'package:hadi_hoda_flutter/core/utils/storage_path.dart'; | |
| import 'package:hadi_hoda_flutter/init_bindings.dart'; | |
| import 'package:hadi_hoda_flutter/l10n/app_localizations.dart'; | |
| 
 | |
| Future<void> main() async { | |
|   WidgetsFlutterBinding.ensureInitialized(); | |
|   initBindings(); | |
|   await Future.wait([ | |
|     LocalStorage.init(), | |
|     StoragePath.getDocumentDir(), | |
|     initDataBase(), | |
|     MyDevice.setPortrait(), | |
|     MyDevice.setImmersiveSticky(), | |
|   ]); | |
|   runApp(const MainApp()); | |
| } | |
| 
 | |
| class MainApp extends StatelessWidget { | |
|   const MainApp({super.key}); | |
| 
 | |
|   @override | |
|   Widget build(BuildContext context) { | |
|     return MaterialApp.router( | |
|       theme: MyTheme.light, | |
|       darkTheme: MyTheme.dark, | |
|       themeMode: ThemeService.getTheme(), | |
|       locale: const Locale('en', 'US'), | |
|       supportedLocales: const [Locale('en', 'US')], | |
|       routerConfig: appPages, | |
|       localizationsDelegates: const [ | |
|         AppLocalizations.delegate, | |
|         GlobalMaterialLocalizations.delegate, | |
|         GlobalWidgetsLocalizations.delegate, | |
|         GlobalCupertinoLocalizations.delegate, | |
|       ], | |
|     ); | |
|   } | |
| }
 |