DEV Community

Pere Sola
Pere Sola

Posted on • Edited on

3

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.

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay