Using the flutter_native_splash 2.3.2 lib, I’m defining a custom splash screen for my app. However, when sending to the requester, who uses Android 10, the initial presentation screen only shows the background and does not present the icon correctly. What should I do? I’ve looked elsewhere and haven’t found a solution.
Here is the pubspec.yaml
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
flutter_inappwebview: ^5.7.2+3
flutter_native_splash: ^2.3.2
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.13.1
flutter_icons:
android: true
ios: true
image_path: "images/adecop-logo.png"
flutter_native_splash:
color: "##1e1b3a"
android: true
ios: false
fullscreen: true
icon: "images/adecop-logo.png"
android_12:
icon_backgroound_color: "##1e1b3a"
My main.dart
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
await Future.delayed(Duration(seconds: 1));
FlutterNativeSplash.remove();
runApp(const HomePage());
}
I tried to change some XML settings, looking at the Android documentation, but I didn’t find it very clear and I tried several other solutions pointed out on the internet, videos on youtube, but none with success.
2
Answers
Try adding this line in Manifest
<meta-data android:name="io.flutter.embedding.android.SplashScreenDrawable" android:resource="@drawable/launch_background" />
1.step—-> paste your image this path (…androidappsrcmainresdrawable)
2.step—-> …androidappsrcmainresdrawablelaunch_background.xml
my image name :logo_final you can change your image name this part of code
…… androidappsrcmainresvaluesstyles.xml
and also now we have a some problem about resize splash screen photo if i will find i will share 🙂