Configure splash screen
A splash screen provides a branded loading experience when your app starts up. Flex Storefront uses flutter_native_splash
to generate native splash screens for iOS, Android, and Web platforms, replacing the default white loading screen with your custom design.
Setup Instructions
1. Prepare Your Assets
Create a splash screen image that is:
- Simple and centered
- PNG format with transparency where needed
- At least 1024x1024 pixels (will be automatically scaled)
- 4x pixel density for retina displays (iOS, Android 12+)
- Preferably your logo or primary branding element
2. Configure flutter_native_splash
Add your configuration to flutter_native_splash.yaml
in your project root:
3. Generate Splash Screens
Run the following command:
This will:
- Generate native code for iOS and Android
- Create necessary image assets
- Update platform configurations
- Set up web splash if enabled
4. Test the Splash Screen
Test your splash screen on:
- Light and dark modes
- Different device sizes
- Both iOS and Android devices
- Web browser (if enabled)
Customization Options
Basic Options
color
: Background colorimage
: Path to splash imageandroid_12
: Android 12+ specific settingsfullscreen
: Enable fullscreen mode
Dark Mode Support
color_dark
: Dark mode background colorimage_dark
: Dark mode splash image
Platform-Specific Settings
For the full list of customizations, check the yaml file directly, or flutter_native_splash
Troubleshooting
Common issues and solutions:
- White flash before splash: Ensure background color matches app’s initial screen
- Image not centered: Check platform-specific gravity/content mode settings
- Blurry image: Provide higher resolution source image