I need show Splash Screen(image: background_light_SC.png) when user open my application and flutter load my application. I use this package, and all work good. But if I start my application in android 12, I see white background with my icon app in Splash Screen.
pubspec.yaml
flutter_native_splash:
background_image: "assets/images/background_light_SC.png"
android: true
android12: true
ios: true
Whats wrong? In all android up to Android 12, everything works well.
Follow the steps outlined here to set up the flutter_native_splash package. https://pub.dev/packages/flutter_native_splash
For Android 12, you will need to specify the following in the flutter_native_splash.yaml file, just like the above user specified:
android_12:
# The image parameter sets the splash screen icon image. If this parameter is not specified,
# the app's launcher icon will be used instead.
# Please note that the splash screen will be clipped to a circle on the center of the screen.
# App icon with an icon background: This should be 960×960 pixels, and fit within a circle
# 640 pixels in diameter.
# App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle
# 768 pixels in diameter.
#image: assets/android12splash.png
# Splash screen background color.
#color: "#42a5f5"
# App icon background color.
#icon_background_color: "#111111"
# The image_dark parameter and icon_background_color_dark set the image and icon background
# color when the device is in dark mode. If they are not specified, the app will use the
# parameters from above.
#image_dark: assets/android12splash-invert.png
#color_dark: "#042a49"
#icon_background_color_dark: "#eeeeee"
All you need to do is uncomment the fields that pertain to your application. For example, you may only need to set
image: assets/android12splash.png
After you finish making your changes, make sure to run the following commands in the root directory of your project in order to build the splash screen:
flutter clean
flutter pub get
flutter pub run flutter_native_splash:create --path=path/to/your/flutter_native_splash.yaml
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With