Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

i have a problem with splash screen in android with Flutter, still white in physical device and emulator. Already tried to unistall app. Some advice?

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/red" />

<!-- You can insert your own image assets here 
 <item>
    <bitmap
        android:gravity="center"
        android:src="@drawable/logo" />
</item>-->

if i comment this, it show black:

 <meta-data
          android:name="io.flutter.embedding.android.SplashScreenDrawable"
          android:resource="@drawable/launch_background"
          />

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
417 views
Welcome To Ask or Share your Answers For Others

1 Answer

You could check the flutter_native_splash package. It'll replace the color on IOS & Android automatically.

Update : It worked with me fine :

Use :

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_native_splash: ^0.1.9

flutter_native_splash:
  color: "FF0000"

then run the command again :

flutter pub pub run flutter_native_splash:create

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...