DEV Community

Pere Sola
Pere Sola

Posted on • Edited on

Change Flutter launcher icon for Android

Flutter ships with their default launcher icon. It is nice but you probably want a custom one. These are the steps I took to change mine:

1.- Get a the image you want to use as a launch icon as png.
2.- Save it in assets/whatever_the_name_of_the_file.png.
3.- Install flutter_launcher_icons library (link here). We are setting the icon for Android only, so add the following to pubspec.yaml:

flutter_icons:
  image_path: "assets/whatever_the_name_of_the_file.png"
  android: true
Enter fullscreen mode Exit fullscreen mode

4.- Run:

flutter pub get
flutter pub run flutter_launcher_icons
Enter fullscreen mode Exit fullscreen mode

The second command will generate the images in the appropriate android folders. Please note that the app cannot be running in development, otherwise you will get errors.

5.- That's it. There are other attributes that you can use for other platforms and other settings, but I didn't need to use them. Read about them in the package documentation.

Top comments (0)