When I create an app with a flutter create
command, the flutter logo is used as an application icon for both platforms.
If I want to change the app icon,
Flutter Launcher Icons has been designed to help quickly generate launcher icons for both Android and iOS: https://pub.dartlang.org/packages/flutter_launcher_icons
I'm hoping to add a video to the GitHub README to demonstrate it
Video showing how to run the tool can be found here.
If anyone wants to suggest improvements / report bugs, please add it as an issue on the GitHub project.
Update: As of Wednesday 24th January 2018, you should be able to create new icons without overriding the old existing launcher icons in your Flutter project.
Update 2: As of v0.4.0 (8th June 2018) you can specify one image for your Android icon and a separate image for your iOS icon.
Update 3: As of v0.5.2 (20th June 2018) you can now add adaptive launcher icons for the Android app of your Flutter project
Best & Recommended way to set App Icon in Flutter.
I found one plugin to set app icon in flutter named flutter_launcher_icons. We can use this plugin to set the app icon in flutter.
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
flutter_launcher_icons: ^0.7.2+1**
Save the file and run flutter pub get on terminal.
Create a folder assets in the root of the project in folder assets also create a folder icon and place your app icon inside this folder. I will recommend to user 1024x1024 app icon size. I have placed app icon inside icon folder and now I have app icon path as assets/icon/icon.png
Now, in pubspec.yaml add the below code,
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
flutter pub run flutter_launcher_icons:main -f pubspec.yaml
Then Run App
I have changed it in the following steps:
1) please add this dependency on your pubspec.yaml page
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.7.4
2) you have to upload an image/icon on your project which you want to see as a launcher icon. (i have created a folder name:image in my project then upload the logo.png in the image folder). Now you have to add the below codes and paste your image path on image_path: in pubspec.yaml page.
flutter_icons:
image_path: "images/logo.png"
android: true
ios: true
3) Go to terminal and execute this command:
flutter pub get
4) After executing the command then enter below command:
flutter pub run flutter_launcher_icons:main
5) Done
N.B: (of course add an updated dependency from
https://pub.dev/packages/flutter_launcher_icons#-installing-tab-
)
Follow simple steps:
flutter_launcher_icons
Plugin to pubspec.yaml
e.g.
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.8.1"
flutter_icons:
image_path: "icon/icon.png"
android: true
ios: true
Prepare an app icon for the specified path.
e.g. icon/icon.png
Execute command on the terminal to Create app icons:
$ flutter pub get
$ flutter pub run flutter_launcher_icons:main
To check check all available options and to set different icons for android and iOS please refer this
Update:
flutter_launcher_icons 0.8.0
Version (12th Sept 2020) has Added flavours support
Flavors are typically used to build your app for different environments such as dev
and prod
The community has written some articles and packages you might find useful. These articles address flavors for both iOS and Android.
Hope this will helps others.
I would suggest You to use this website Linked Below
App Icon Creator
Step-1: upload The Image,
Step-2: Make necessary Changes And Click on download(dont change the file name)
Step-3: Extract the Downloaded Zip File In the respective folder
android/app/src/main/res