Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

flutter launcher icons

a command-line tool which simplifies the task of updating your flutter app’s launcher icon. fully flexible, allowing you to choose what platform you wish to update the launcher icon for and if you want, the option to keep your old launcher icon in case you want to revert back sometime in the future.

:book: guide

1. setup the config file

add your flutter launcher icons configuration to your pubspec.yaml or create a new config file called flutter_launcher_icons.yaml.
an example is shown below. more complex examples can be found in the example projects.

dev_dependencies:
  flutter_launcher_icons: "^0.9.1"

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

if you name your configuration file something other than flutter_launcher_icons.yaml or pubspec.yaml you will need to specify
the name of the file when running the package.

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

note: if you are not using the existing pubspec.yaml ensure that your config file is located in the same directory as it.

2. run the package

after setting up the configuration, all that is left to do is run the package.

flutter pub get
flutter pub run flutter_launcher_icons:main

if you encounter any issues please report them here.

in the above configuration, the package is setup to replace the existing launcher icons in both the android and ios project
with the icon located in the image path specified above and given the name “launcher_icon” in the android project and “example-icon” in the ios project.

:mag: attributes

shown below is the full list of attributes which you can specify within your flutter launcher icons configuration.

  • android/ios
    • true: override the default existing flutter launcher icon for the platform specified
    • false: ignore making launcher icons for this platform
    • icon/path/here.png: this will generate a new launcher icons for the platform with the name you specify, without removing the old default existing flutter launcher icon.
  • image_path: the location of the icon image file which you want to use as the app launcher icon
  • image_path_android: the location of the icon image file specific for android platform (optional – if not defined then the image_path is used)
  • image_path_ios: the location of the icon image file specific for ios platform (optional – if not defined then the image_path is used)

note: ios icons should fill the entire image and not contain transparent borders.

the next two attributes are only used when generating android launcher icon

  • adaptive_icon_background: the color (e.g. "#ffffff") or image asset (e.g. "assets/images/christmas-background.png") which will
    be used to fill out the background of the adaptive icon.
  • adaptive_icon_foreground: the image asset which will be used for the icon foreground of the adaptive icon

flavor support

create a flutter launcher icons configuration file for your flavor. the config file is called flutter_launcher_icons-<flavor>.yaml by replacing <flavor> by the name of your desired flavor.

the configuration file format is the same.

an example project with flavor support enabled has been added to the examples.

:question: troubleshooting

listed a couple common issues with solutions for them

generated icon color is different from the original icon

caused by an update to the image dependency which is used by flutter launcher icons.

use #aarrggbb for colors instead of ##aabbggrr, to be compatible with flutter image class.

related issue

image foreground is too big / too small

for best results try and use a foreground image which has padding much like the one in the example.

related issue

dependency incompatible

you may receive a message similar to the following

because flutter_launcher_icons >=0.9.0 depends on args 2.0.0 and flutter_native_splash 1.2.0 depends on args ^2.1.1, flutter_launcher_icons >=0.9.0 is incompatible with flutter_native_splash 1.2.0.
and because no versions of flutter_native_splash match >1.2.0 <2.0.0, flutter_launcher_icons >=0.9.0 is incompatible with flutter_native_splash ^1.2.0.
so, because enstack depends on both flutter_native_splash ^1.2.0 and flutter_launcher_icons ^0.9.0, version solving failed.
pub get failed (1; so, because enstack depends on both flutter_native_splash ^1.2.0 and flutter_launcher_icons ^0.9.0, version solving failed.)

for a quick fix, you can temporarily override all references to a dependency: see here for an example.

:eyes: example

video example


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Top