Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replacing app launcher icon in flutter with new icon

I was looking for changing the app icon of my current app. I cane around the package name flutter_launcher_icons.

I also found I can do by putting an image in mipmap-xxxhdpi in android/app/res folder. And it works.

So my question is why we need additional package(flutter_launcher_icons) for this.

like image 462
kunaljosh369 Avatar asked Sep 23 '19 10:09

kunaljosh369


People also ask

How do I change the app launcher icon on flutter?

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 app icon for the platform with the name you specify, without removing the old default existing Flutter launcher icon.


1 Answers

When you use the package flutter_launcher_icons it will automatically generate different icon sizes for the app which is better than just putting an image in mipmap-xxxhdpi in android/app/res.

Example, if you add flutter_launcher_icons to the pubspec.yaml:

dev_dependencies: 
  flutter_launcher_icons: "^0.7.3"

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

Then execute the following:

flutter pub get
flutter pub run flutter_launcher_icons:main

It will generate all the icons under different sizes in the res folder for android and Assets.xcassets for ios.

Check here for more information:

https://github.com/fluttercommunity/flutter_launcher_icons

like image 108
Peter Haddad Avatar answered Sep 21 '22 06:09

Peter Haddad