How to change the application launcher icon in Flutter?

Flutter SDk is an open-source software development kit for creating beautiful ui with native compiled. When we create a flutter project. Default flutter icon shows when the application is installed. In this article we will look at how to set icon in android application.


There are two ways to change app icons on Flutter applications.

1.  Manually changing the file icon in the Android and ios folder.

2. Using a package that will add all the sizes of icons in both Android and iOS automatically.

First ways : Manually changing icons

       Step 1 : Difference sized icons .           

   Step 2: you can generate icons on this website https://www.appicon.co/

 

If you select platforms like android, iPad, etc. then click on generate and download different sizes of icons inside the zip folder.


After extracting folder   


Below mentioned Android different size folders and other platform.


If downloaded folder after the icon paste folder  app>src>res 


Run the application

 After manually changing the images in the Android and iOS folder and the Flutter project using the below command in the Flutter console.

 flutter run



Second ways : Using package “flutter launcher icons “

 Step 1 : Navigate to pubspec.yaml file.

 dev_dependencies:

 flutter_launcher_icons: ^0.13.1

 flutter_test:

   sdk: flutter



 flutter_icons:

 android: "launcher_icon"

 ios: true

 image_path: "assets/images/company_logo.png"


Step 3 : your logo paste in assent>images> path




Step 4 :After executing the below code in the flutter console.

   flutter pub run flutter_launcher_icons:main


Step 5 : After running the flutter project below commend.

 flutter run



Happy coding!


365Bloggy May 20, 2024
Share this post
Tags
SUBSCRIBE THIS FORM


Archive