flutter

Splash screen icon and color in Flutter

In this code example, we are going to show how you can change or add icon and color to the launcher or splash screen in Flutter.

First, create a file at the location - android/app/src/main/res/values/colors.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <color name="bg_color">#6023e0</color>
</resources>

Edit the code in the file - android/app/src/main/res/drawable/launch_background.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/bg_color" />

    <!-- You can insert your own image assets here -->
    <!-- <item>
        <bitmap
            android:gravity="center"
            android:src="@mipmap/launch_image" />
    </item> -->
</layer-list>

For Android API Level 21 or higher

If you are using Android API level 21 or higher, Also make the changes in drawable-v21/launch_background.xml.

Was this helpful?