android – Change Splash Screen Color Programmatically in Flutter-ThrowExceptions

Exception or error:


<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="">
    <item android:drawable="@color/orange" />
    <!-- You can insert your own image assets here -->
            android:src="@drawable/splash_icon" />
    </item> -->


<?xml version="1.0" encoding="utf-8"?>
    <style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
        <!-- Show a splash screen on the activity. Automatically removed when
             Flutter draws its first frame -->
        <item name="android:windowBackground">@drawable/launch_background</item>
    <color name="orange">#FF9800</color>

I change the primary color value in the app dynamically and set theme colors for app. How can I send the primary color value here –> <color name="orange">#FF9800</color>

Also what should I do for IOS?

How to solve:

As far as I know, you can’t change values of an XML file programmatically.

Leave a Reply

Your email address will not be published. Required fields are marked *