-
First, create a new image asset that you want to use as the application launcher icon. You can do this by either designing a new image or using an existing one.
-
Save the image asset in your project directory. It's recommended to create a new directory named "assets" within your project directory and save the image asset within it.
-
Open your project configuration file ‘pubspec.yaml’.
-
Add the following lines of code to include the image asset in your project:
flutter:
assets:
- assets/your_image_file_name.png
-
Save the file and close it.
-
Open the file named "AndroidManifest.xml" located in the "android/app/src/main" folder.
-
Look for the following code:
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
- Replace the "ic_launcher" and "ic_launcher_round" with the file name of your image asset that was added in step 4.
android:icon="@mipmap/your_image_file_name"
android:roundIcon="@mipmap/your_image_file_name_round"
-
Save the file and close it.
-
Finally, rebuild your project by running the command "flutter pub get" on the terminal followed by "flutter run" or by restarting your application.
Your application launcher icon should now be changed to the new image asset.