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.
		
		
		
		
		
			
		
			
				
					
					
						
							93 lines
						
					
					
						
							2.5 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							93 lines
						
					
					
						
							2.5 KiB
						
					
					
				| import 'package:flutter/material.dart'; | |
| import 'package:flutter_bloc/flutter_bloc.dart'; | |
| import 'package:hadi_hoda_flutter/common_ui/resources/my_assets.dart'; | |
| import 'package:hadi_hoda_flutter/common_ui/resources/my_spaces.dart'; | |
| import 'package:hadi_hoda_flutter/core/utils/screen_size.dart'; | |
| import 'package:hadi_hoda_flutter/core/utils/set_platform_size.dart'; | |
| import 'package:hadi_hoda_flutter/core/widgets/animations/rotation_anim.dart'; | |
| import 'package:hadi_hoda_flutter/core/widgets/images/my_image.dart'; | |
| import 'package:hadi_hoda_flutter/features/splash/presentation/bloc/splash_bloc.dart'; | |
| 
 | |
| class SplashPage extends StatefulWidget { | |
|   const SplashPage({super.key}); | |
| 
 | |
|   @override | |
|   State<SplashPage> createState() => _SplashPageState(); | |
| } | |
| 
 | |
| class _SplashPageState extends State<SplashPage> { | |
|   @override | |
|   void initState() { | |
|     super.initState(); | |
|     WidgetsBinding.instance.addPostFrameCallback((_) { | |
|       context.read<SplashBloc>().goToHomePage(context); | |
|     }); | |
|   } | |
| 
 | |
| 
 | |
|   @override | |
|   Widget build(BuildContext context) { | |
|     return Scaffold( | |
|       body: Container( | |
|         height: context.heightScreen, | |
|         width: context.widthScreen, | |
|         decoration: BoxDecoration( | |
|           gradient: LinearGradient( | |
|             begin: Alignment.topCenter, | |
|             end: Alignment.bottomCenter, | |
|             colors: [ | |
|               Color(0XFF00154C), | |
|               Color(0XFF150532), | |
|             ], | |
|           ), | |
|           image: DecorationImage( | |
|             image: AssetImage(MyAssets.pattern), | |
|             scale: 3, | |
|             repeat: ImageRepeat.repeat, | |
|             colorFilter: ColorFilter.mode( | |
|               Colors.white.withValues(alpha: 0.2), | |
|               BlendMode.srcIn, | |
|             ), | |
|           ), | |
|         ), | |
|         child: Stack( | |
|           alignment: Alignment.center, | |
|           children: [ | |
|             _image(), | |
|             _loading(context), | |
|           ], | |
|         ), | |
|       ), | |
|     ); | |
|   } | |
| 
 | |
|   Widget _image() { | |
|     return Stack( | |
|       children: [ | |
|         MyImage( | |
|           image: MyAssets.hadiHoda, | |
|         ), | |
|         PositionedDirectional( | |
|           start: MySpaces.s10, | |
|           top: MySpaces.s40, | |
|           child: MyImage( | |
|             image: MyAssets.globe, | |
|           ), | |
|         ), | |
|       ], | |
|     ); | |
|   } | |
| 
 | |
| 
 | |
|   Positioned _loading(BuildContext context) { | |
|     return Positioned( | |
|       bottom: MySpaces.s40, | |
|       child: RotationAnim( | |
|         child: MyImage( | |
|           image: MyAssets.loading, | |
|           size: setSize(context: context, mobile: 70, tablet: 100), | |
|         ), | |
|       ) | |
|     ); | |
|   } | |
| }
 |