The easiest way to add a splash screen in flutter is imho this package: https://pub.dev/packages/flutter_native_splash
Add your settings to your project's pubspec.yaml file or create a file in your root project folder named flutter_native_splash.yaml with your settings.
flutter_native_splash:
image: assets/images/splash.png
color: "42a5f5"
image must be a png file.
You can use # in color as well. color: "#42a5f5" You can also set android or ios to false if you don't want to create a splash screen for a specific platform.
flutter_native_splash:
image: assets/images/splash.png
color: "42a5f5"
android: false
In case your image should use all available screen (width and height) you can use fill property.
flutter_native_splash:
image: assets/images/splash.png
color: "42a5f5"
fill: true
Note: fill property is not yet implemented for iOS splash screens.
If you want to disable full screen splash screen on Android you can use android_disable_fullscreen property.
flutter_native_splash:
image: assets/images/splash.png
color: "42a5f5"
android_disable_fullscreen: true
After adding your settings, run the package with
flutter pub pub run flutter_native_splash:create
When the package finishes running your splash screen is ready.