How to update the Flutter app launcher icon

Learn to update the Flutter app launcher icon.

· 2 min read
How to update the Flutter app launcher icon

Hello everyone, In this article, I will be discussing how we can update the app icon of your Flutter app.

To do this we are going to use flutter_launcher_icons the plugin. It is a command-line tool that simplifies the task of updating your Flutter app's launcher icon.

Setup

  1. Add the flutter_launcher_icons dependency in your pubspec.yaml.

Please be sure the check the latest version for the package from the link at the bottom.

dev_dependencies:
  flutter_launcher_icons: "^0.9.2"

2. Now add the configuration settings to your pubspec.yaml file.

flutter_icons:
  android: "launcher_icon"
  ios: true
  image_path: "assets/icon/icon.png"

You can also add this configuration in a different yaml file instead of pubspec.yaml file. But you must ensure that the other file will be in the same folder as the pubspec.yaml file.

Now fetch the dependencies

flutter pub get

Basic Usage

flutter pub run flutter_launcher_icons:main

This will update the launcher icons for both android and ios as configured in pubspec.yaml file.

You can also update the icons using different configuration files using this command.

flutter pub run flutter_launcher_icons:main -f <your config file name here>

Configuration in details

In the flutter_launcher_icons configuration current I have used three options

  1. android
  2. ios
  3. image_path - The location of the new icon.

Here android/ios both can have these values

  1. true - If set to true it will update the icon of the specified platform.
  2. false - If set false it will not update the icon of the specified platform.
  3. new_icon_path - If specified it will save the new icon according to this without removing the previous icon.

Other than this you can also specify the separate icon for both android and ios separately using these options

  1. image_path_android
  2. image_path_ios

Note: iOS icons should fill the entire image and not contain transparent borders

For more details please go through the plugin page

flutter_launcher_icons | Dart Package
A package which simplifies the task of updating your Flutter app’s launcher icon.

I hope you had found this article informative. If you have any problems you can ask me in the comment section.

Related Articles

How to take screenshot in Flutter
· 2 min read
Flutter Localization Tutorial
· 5 min read