Skip to main content

launcher_icons

PackageKindProvides the roleNeedsChoose with
smf_launcher_iconsinfrastructureApp iconnothing-m launcher_icons

launcher_icons makes the icon of the app with flutter_launcher_icons: an opaque icon on iOS and an adaptive icon with a themed variant on Android, in place of the logo of Flutter. All flavors of the app share the icon. To replace the images, see App icon and splash screen.

What it adds to the app​

In the appWhat it is
flutter_launcher_icons: ^0.14.4 in the dev dependenciesThe tool. No code of the app imports it.
assets/branding/icon.png1024 by 1024 and opaque, for iOS and older versions of Android. It shows the mark of Say My Frame in cream on green.
assets/branding/icon_foreground.png1024 by 1024, the same mark on a transparent background, for the adaptive icon of Android
flutter_launcher_icons.yamlHow the tool makes the icon, with the colour #0F3326 behind the mark on Android, and the second image as the themed icon too
tool/update_app_icon.dartThe script that runs the tool, and that you run again after a change
The section "Launcher icons" of the READMEWhat the images show, and the command

Whichever module provides it, the role adds the section "App icon" of the README. The app does not bundle the images.

In the guide for coding agents of the app, the role names the sources under "App icon". The module adds the command, and that an agent neither runs the tool itself nor adds a file for a flavor.

After generation​

The module runs dart tool/update_app_icon.dart once the app has its packages. A run in a terminal asks first, with Enter for yes:

? Making the app icon from assets/branding (dart tool/update_app_icon.dart), for launcher_icons. Run it now? (Y/n)

A run without a terminal runs it too. When the tool fails, you still get the app, with the logo of Flutter, a warning and the command to run later.

Run the script again after you change an image or flutter_launcher_icons.yaml, and commit what changed under android/ and ios/:

dart tool/update_app_icon.dart

Why a script​

flutter_launcher_icons 0.14.4 writes the name of the icon into every build setting of the Xcode project whose name has ASSETCATALOG. One of those settings, ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS, takes YES or NO. The script gives that setting its value back, or YES after a run of the tool alone. So use the script rather than dart run flutter_launcher_icons.

Choosing it​

smf create asks which module provides the app icon, and the answer may be none. To choose it without the question:

smf create my_app -m launcher_icons