I'm using the flutter native splash screen package for customizing the default splash in my flutter splash screen. I added an image to the splash screen, but the image doesn't fit properly.
My current splash screen looks like this:
What I want to achieve:
This is my pubspec
file:
# flutter_native_splash-development.yaml
flutter_native_splash:
color: "#ffffff"
image: assets/icons/splash_icon.png
color_dark: "#121212"
image_dark:
fill: true
assets/icons/splash_icon.png
android_12:
image: assets/icons/splash_icon.png
image_dark: assets/icons/splash_icon.png
Take a look at the details in the Android 12+ section of the readme. The splash image needs blank padding within the image as per Android 12+ Splash API requirements.
Had the same issue, The following worked:
1. logo fixing: https://pub.dev/packages/flutter_native_splash#android-12-support
2. fixing AndroidMenifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="your_app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/LaunchTheme"> <!-- Dont forget to add this -->
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/NormalTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Other activities and services -->
</application>
</manifest>
It worked for me after this fixes and running the
dart run flutter_native_splash:create
and then running flutter run/build
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