flutter
Splash screen icon and color in Flutter
June 14, 2023
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?
Similar Posts
- Change click action of left AppBar icon in Flutter
- Add launcher or mobile app icon in Fluter
- Dismiss the mobile screen keyboard in Flutter
- Convert HexColor to Flutter color
- Change the color of icons in appbar flutter
- Change circular progress indicator color in Flutter
- Center Row widget children vertically and horizontally Flutter