Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 282 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change the application launcher icon on Flutter?

#1
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, shall I go to both platforms directories and replace images there?, by platforms directories I mean `myapp/ios/Runner/Assets.xcassets/AppIcon.appiconset` for iOS and `myapp/android/app/src/main/res` for Android.

Or is it possible to define an image as a [Flutter Asset](

[To see links please register here]

) and the icons are generated somehow?.
Reply

#2
You have to replace the Flutter icon files with images of your own. This site will help you turn your png into launcher icons of various sizes:

[To see links please register here]

Reply

#3
Best way is to change launcher icons separately for both iOS and Android.

Change the icons in iOS and Android module separately.
The plugin produces different size icons from the same icon which are distorted.

Follow this link:

[To see links please register here]

Reply

#4
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

>

[To see links please register here]

-

)
Reply

#5
**I would suggest You to use this website Linked Below**

[App Icon Creator][1]

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
```


[1]:

[To see links please register here]

Reply

#6
Flutter Launcher Icons has been designed to help quickly generate launcher icons for both Android and iOS:

[To see links please register here]


- Add the package to your pubspec.yaml file (within your Flutter project) to use it
- Within pubspec.yaml file specify the path of the icon you wish to use for the app and then choose whether you want to use the icon for the iOS app, Android app or both.
- Run the package
- Voila! The default launcher icons have now been replaced with your custom icon

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][1].

If anyone wants to suggest improvements / report bugs, please [add it as an issue on the GitHub project][2].

**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


[1]:
[2]:

[To see links please register here]

Reply

#7
**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.


1. Add this plugin in pubspec.yaml file in project root directory. Please check below code,
```yaml
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.

2. 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

3. Now, in pubspec.yaml add the below code,

```yaml
flutter_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
```
4. Save the file and run flutter pub get on terminal. After running command run second command as below

```bash
flutter pub run flutter_launcher_icons:main -f pubspec.yaml
```

Then Run App
Reply

#8
Follow these steps:-

**1.** Add dependencies of **flutter_luncher_icons** in **pubspec.yaml** file.You can find this plugin from [here][1].

**2.** Add your required images in **asstes folder** and **pubspec.yaml** file as below .

**pubspec.yaml**
```
name: NewsApi.org
description: A new Flutter application.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

[To see links please register here]

version: 1.0.0+1

environment:
sdk: ">=2.7.0 <3.0.0"

dependencies:
flutter:
sdk: flutter


# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.1
fluttertoast: ^7.1.6
toast: ^0.1.5
flutter_launcher_icons: ^0.8.0




dev_dependencies:
flutter_test:
sdk: flutter

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

# The following section is specific to Flutter.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
assets:
- assets/images/dropbox.png



fonts:
- family: LangerReguler
fonts:
- asset: assets/langer_reguler.ttf




# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see

[To see links please register here]

```


**3.** Then run the command in terminal **flutter pub get** and then **flutter_luncher_icon**.This is what I get the result after the successfully run the command . And luncher icon is also generated successfully.

**My Terminal**
```
[E:\AndroidStudioProjects\FlutterProject\NewsFlutter\news_flutter>flutter pub get
Running "flutter pub get" in news_flutter... 881ms

E:\AndroidStudioProjects\FlutterProject\NewsFlutter\news_flutter>flutter pub run flutter_launcher_icons:main
════════════════════════════════════════════
FLUTTER LAUNCHER ICONS (v0.8.0)
════════════════════════════════════════════

• Creating default icons Android
• Overwriting the default Android launcher icon with a new icon

✓ Successfully generated launcher icons
```

[1]:

[To see links please register here]

Reply

#9
# Setting the launcher icons like a native developer

I was having some trouble using and understanding the [flutter_launcher_icons][1] package. This answer is how you would do it if you were creating an app for Android or iOS natively. It is pretty fast and easy once you have done it a few times.

# Android

Android launcher icons have both a foreground and a background layer.

[![enter image description here][2]][2]

*(image adapted from [Android documentation][3])*

The easiest way to create launcher icons for Android is to use the Asset Studio that is available right in Android Studio. You don't even have to leave your Flutter project. (VS Code users, you might consider using Android Studio just for this step. It's really very convenient and it doesn't hurt to be familiar with another IDE.)

Right click on the `android` folder in the project outline. Go to **New > Image Asset**. (Try right clicking the `android/app` folder if you don't see **Image Asset** as an option. Also see the comments below for more suggestions.) Now you can select an image to create your launcher icon from.

> **Note:** I usually use a `1024x1024` pixel image but you should certainly
> use nothing smaller that `512x512`. If you are using Gimp or Inkscape, you
> should have two layers, one for the foreground and one for the
> background. The foreground image should have transparent areas for the
> background layer to show through.

[![enter image description here][4]][4]

*(lion clipart from [here][5])*

This will replace the current launcher icons. You can find the generated icons in the `mipmap` folders:

<img src="https://i.stack.imgur.com/n7ax9.png" width="300" >

If you would prefer to create the launcher icons manually, see [this answer][6] for help.

Finally, make sure that the launcher icon name in the AndroidManifest is the same as what you called it above (`ic_launcher` by default):

application android:icon="@mipmap/ic_launcher"

Run the app in the emulator to confirm that the launcher icon was created successfully.

# iOS

I always used to individually resize my iOS icons by hand, but if you have a Mac, there is a free app in the Mac App Store called [Icon Set Creator][7]. You give it an image (of at least `1024x1024` pixels) and it will spit out all the sizes that you need (plus the `Contents.json` file). Thanks to [this answer][8] for the suggestion.

iOS icons should not have any transparency. See more guidelines [here][9].

After you have created the icon set, start Xcode (assuming you have a Mac) and use it to open the `ios` folder in your Flutter project. Then go to **Runner > Assets.xcassets** and delete the AppIcon item.

[![enter image description here][10]][10]

After that right-click and choose **Import...**. Choose the icon set that you just created.

That's it. Confirm that the icon was created by running the app in the simulator.

### If you don't have a Mac...

You can still create all of the images by hand. In your Flutter project go to `ios/Runner/Assets.xcassets/AppIcon.appiconset`.

<img src="https://i.stack.imgur.com/B9CKd.png" width="350" >

The image sizes that you need are the multiplied sizes in the filename. For example, `[email protected]` would be `29` times `3`, that is, `87` pixels square. You either need to keep the same icon names or edit the JSON file.


[1]:

[To see links please register here]

[2]:

[3]:

[To see links please register here]

[4]:

[5]:

[To see links please register here]

[6]:

[To see links please register here]

[7]:

[To see links please register here]

[8]:

[To see links please register here]

[9]:

[To see links please register here]

[10]:
Reply

#10
Flutter has its own default icon for every app in its Android and Ios folder so there are few steps that I would like to show to change the app icon.

1. Head over to

[To see links please register here]

and generate your own icon using
icon image (the zip file contains two main folders **android** and
**Assets.xcassets**)
2. For android: Go inside **android\app\src\main\res** in your flutter app and there paste the android folder content.
3. For IOS: Go inside **ios\Runner** in your flutter app and there paste the Assets.xcassets
content
4. Restart your emulator or rebuild your application 😁
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through