How to change the application launcher icon on Flutter?

It’s simple gratitude to flutter_launcher_icons 💖

How it functions

Here I will utilize NameMe for instance.

Image for post
NameMe adaptive icon on Android

Three custom png documents will be added to the undertaking, and in the wake of refreshing pubspec.yaml and running the module, all leftover resources will be produced and consequently bundled when executing vacillate run or ripple fabricate.

I would energetically prescribe utilizing Illustrator to make your resources, and utilize 900×900. For more data on the most proficient method to make an Android versatile symbol see this article by Nick, it incorporates Bjango layouts which you may discover helpful. See the NameMe Android Illustrator record and iOS format.

Guidelines

  1. First make a background.png and a foreground.png record for an Android versatile symbol, see models and test your resources at Adapticon.
Image for post
Android assets

2. At that point make a solitary icon.png for iOS and fallback for Android, I think I’ve caused mine wrong, to please take a stab at utilizing this format. I would suggest one Android fallback symbol (with drop shadow) and follow the format for the iOS one.

Image for post
iOS asset
  1. Add the three png documents into an organizer (I picked resources/launcher/)
  2. Alter pubspec.yaml
dev_dependencies: 
  flutter_launcher_icons: "^0.7.0"
flutter_icons:
  ios: true
  android: true
  image_path_ios: "assets/launcher/icon.png"
  image_path_android: "assets/launcher/icon.png"
  adaptive_icon_background: "assets/launcher/background.png"
  adaptive_icon_foreground: "assets/launcher/foreground.png"

5. Run the accompanying orders

flutter packages get
flutter packages pub run flutter_launcher_icons:main

6. Check that you can see the new symbol when running shudder run or vacillate assemble and Party 🎉

Thank you…..

Leave a Comment