DEV Community

Rui Kowase
Rui Kowase

Posted on

How to generate Flutter app icons for iOS and Android

TL;DR

Use flutter_launcher_icons that Command line tool.

Environment

  • Flutter 0.1.5
  • Dart 2.0.0-dev.28.0
  • flutter_launcher_icons 0.2.0

How to create

1. Add flutter_launcher_icons Plugin

Add flutter_launcher_icons to pubspec.yaml

dev_dependencies: 
  flutter_test:
    sdk: flutter

  flutter_launcher_icons: "^0.2.0"

flutter_icons:
  image_path: "icon/icon.png" 
  android: true
  ios: true
Enter fullscreen mode Exit fullscreen mode

2. Prepare app icon

Prepare an app icon for the specified path.
e.g. icon/icon.png

3. Create app icons

Execute this on terminal.

$ flutter pub get
$ flutter pub pub run flutter_launcher_icons:main
Enter fullscreen mode Exit fullscreen mode

File list

These are file list after command execution.

+1 -1 M android/app/src/main/AndroidManifest.xml
+0 -0 M android/app/src/main/res/mipmap-hdpi/ic_launcher.png
+0 -0 M android/app/src/main/res/mipmap-mdpi/ic_launcher.png
+0 -0 M android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
+0 -0 M android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
+0 -0 M android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
+0 -0 A icon/ic_launcher.png
+71 -0 A ios/Podfile
+1 -1 M ios/Runner.xcodeproj/project.pbxproj
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@1x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@2x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-20x20@3x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@1x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@2x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-29x29@3x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@1x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@2x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-40x40@3x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@1x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@2x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-60x60@3x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@1x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-76x76@2x.png
+0 -0 A ios/Runner/Assets.xcassets/AppIcon.appiconset/AppIcon-83.5x83.5@2x.png
+56 -0 M pubspec.lock
+5 -0 M pubspec.yaml
Enter fullscreen mode Exit fullscreen mode

Links

flutter_launcher_icons | Dart Package
https://pub.dartlang.org/packages/flutter_launcher_icons

How to change the application launcher icon on Flutter? - Stack Overflow
https://stackoverflow.com/questions/43928702/how-to-change-the-application-launcher-icon-on-flutter

Top comments (3)

Collapse
 
markosullivan94 profile image
Mark O'Sullivan

Thanks for sharing the package :)

Collapse
 
sandordargo profile image
Sandor Dargo

Small update. If you want to use flutter_launcher_icons with Flutter SDK >2.0 you'll need at least 0.6.1 from this package.

Collapse
 
bartekpacia profile image
Bartek Pacia

Awesome! Exactly what I've been looking for :D