1
votes

I have seen a lot of articles and youtube videos and tried everything however i cannot change the android splash screen color

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/background" />

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

values/colors.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="background">#2196F3</color>
</resources>

Production Build with key output:

enter image description here

1
please share values/styles.xml file, problems can be there - Mol0ko

1 Answers

3
votes

It is really simple to create Native splash screens using this package.

https://pub.dev/packages/flutter_native_splash

add this package in your dev-dependencies

dev_dependencies:
  flutter_native_splash: ^0.2.9

add the following code in your YAML file.

flutter_native_splash:
  color: "#42a5f5"
  image: "assets/splash.png"

and run the command

flutter pub run flutter_native_splash:create

That's all, This package will take care of all the process.

FYI: This creates native splash screens for both Android and iOS, but you can control it too. if you want to create only for Android, you can set the iOS property to false. Documentation of the Package is pretty clear.