How to change app launch icon in Flutter

The app launch icon is the icon that appears on our device's home screen when we launch our app. It is a great way to brand and makes our app stand out.

Implementation

We can follow the instructions given below to change the application launch icon.

Prepare the custom app icons

To generate different-sized icons for both Android and iOS simultaneously, we can follow these steps.

  1. Visit the website App Icon.

  2. Upload our icon image by clicking the "Upload your app icon" button.

  3. Tick the iPhone and Android options checkboxes to generate icons for both platforms.

  4. Click on the Generate button, and this website will automatically create different-sized icons for Android and iOS.

  5. It will generate a zip folder named AppIcons with android, Assets.xcassets named folders, app store, and Play Store icons.

Adding icons in Android 

To update the app icon in the Android platform of our Flutter project, we can follow these steps.

  1. We can open our Flutter project in our preferred code editor or IDE.

  2. Locate the android/app/src/main/res directory within our project.

  3. Inside the res directory, we will find multiple mipmap-* folders.

  4. Replace these mipmap-* folders with the corresponding mipmap-* folders from the downloaded AppIcons zip file.

  5. Once we have replaced the folders, the new app icon resources will be in place for the Android platform.

Adding icons in iOS

To update the app icon in the iOS platform of our Flutter project, follow these steps.

  1. Navigate to the ios/Runner/ directory in our Flutter project.

  2. Locate the Assets.xcassets folder within the Runner directory.

  3. Delete the existing Assets.xcassets folder.

  4. Now, open the folder where we have downloaded the new app icon assets (let's assume it's named AppIcon).

  5. Copy the Assets.xcassets folder from the AppIcon folder.

  6. Paste the copied Assets.xcassets folder into the ios/Runner/ directory of our Flutter project.

Update the configuration files

After replacing the icons, we need to update the configuration files in our Flutter project to reference the new icons.

  • For Android: Open the android/app/src/main/AndroidManifest.xml file and locate the <application> tag. Add or modify the android:icon attribute inside it to specify the path to our custom app icon. For example:

<application
        android:label="exampleapp"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">

Note: Replace ic_launcher with the name of our custom icon file (without the file extension).

  • For iOS: Open the ios/Runner/Info.plist file and locate the <key>CFBundleIcons</key> section. If not found, create one. Inside it, update the CFBundlePrimaryIcon and CFBundleIconFiles entries to reference our custom app icon file names. For example:

<key>CFBundleIcons</key>
<dict>
    <key>CFBundlePrimaryIcon</key>
    <dict>
        <key>CFBundleIconFiles</key>
        <array>
            <string>ic_launcher</string>
        </array>
    </dict>
</dict>

Test and build

After making the necessary changes, we must test our app to ensure the custom app launch icon is displayed correctly. For that, we can run the following command:

flutter run

Note: It is recommended to perform a clean build (flutter clean) and restart your IDE to ensure that the changes are applied correctly.

Conclusion

We can easily customize the app launch icon in your Flutter application by following the provided steps. This allows us to create a unique and visually appealing brand identity, enhancing the user experience from the moment they install and open your app.

Copyright ©2024 Educative, Inc. All rights reserved