DEV Community

Anurag Verma
Anurag Verma

Posted on

Add app icon in flutter mobile app

To add an app icon to a Flutter mobile app, follow these steps:

  1. Create a new folder in the root of your Flutter project called "assets". This is where you will store your app icons.

  2. Add your app icons to the "assets" folder. Make sure to include versions of the icon for different screen densities, such as 1x, 2x, 3x, and 4x. You can generate these versions using a tool like https://makeappicon.com/.

  3. Open the pubspec.yaml file in the root of your Flutter project. This file contains the configuration for your Flutter app, including the assets that it uses.

  4. Under the "flutter" section, add an entry for each of your app icons to the "assets" list. For example:

flutter:
  assets:
    - assets/icon/icon.png
    - assets/icon/icon_2x.png
    - assets/icon/icon_3x.png
    - assets/icon/icon_4x.png
Enter fullscreen mode Exit fullscreen mode
  1. Run the following command to update the Flutter app with the new icons:
flutter pub get
Enter fullscreen mode Exit fullscreen mode
  1. Finally, specify the app icon in the AndroidManifest.xml file for Android and the Info.plist file for iOS. For example, in the AndroidManifest.xml file, you would add the following line:
<application
    android:icon="@mipmap/ic_launcher"
    ...>
Enter fullscreen mode Exit fullscreen mode

Replace "ic_launcher" with the name of your app icon file.

That's it! Your Flutter app should now use the app icon that you specified.

Hope you like this... Happy coding...

Top comments (2)

Collapse
 
gurudayal123 profile image
Gurudayal123 • Edited

Very well described. I was searching every where but this contant is mindblowing...@anurag629

Collapse
 
anurag629 profile image
Anurag Verma • Edited

Thanks @gurudayal123