3

I added a launch screen consisting of a PNG image to my Flutter app (Android). There is a very noticeable "fade to black" between the launch screen and the Flutter app being displayed. I'm not talking about a sudden black screen, but the launch screen really fades out for ~500 ms and then the Flutter app appears.

I have followed the migration guide to use Android Embedding v2 (but I wasn't using a splash screen before, so I don't know if the migration is the cause of this issue).

This is my launch_background.xml:

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

    <item>
        <bitmap
            android:gravity="center"
            android:src="@drawable/splash_foreground" />
    </item>
</layer-list>

and this is my normal_background.xml:

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

    <item
        android:gravity="fill"
        android:drawable="@drawable/wood1" />

</layer-list>

Even if I replace the image in launch_background.xml with just a white color, it still fades to black before rendering the Flutter app.

Any ideas what could be causing the launch screen to fade to black before rendering the app?

Magnus
  • 17,157
  • 19
  • 104
  • 189

1 Answers1

2

Maybe you forgot to add this on your AndroidManifest, between < activity> ... < /activity>

<meta-data
       android:name="io.flutter.embedding.android.SplashScreenDrawable"
   android:resource="@drawable/launch_background"
/>
Mukul
  • 1,020
  • 6
  • 12