✨ Icons Launcher ✨

A command-line tool that simplifies the task of updating your Flutter app's launcher icon. Full flexibility allows you to only update the launcher icon for specific platforms as needed.

Pub Package Star on Github Forks on Github Contributors Build Status Code size License: MIT Platform

icons launcher preview

Platform Support

AndroidiOSMacOSWebLinuxWindows
✔️✔️✔️✔️✔️✔️

Guide

1. Setup the config file

Add your Icons Launcher configuration to your pubspec.yaml or create a new config file called icons_launcher.yaml.

An example is shown below. More complex examples here.

Method 1: use with pubspec.yaml

dev_dependencies:
  icons_launcher: ^2.0.0

icons_launcher:
  image_path: 'assets/ic_logo_border.png'
  platforms:
    android:
      enable: true
    ios:
      enable: true

Method 2: create icons_launcher.yaml at project root

icons_launcher:
  image_path: 'assets/ic_logo_border.png'
  platforms:
    android:
      enable: true
    ios:
      enable: true

2. Run the package

After setting up the configuration, all that is left to do is run the package:

flutter pub get
flutter pub run icons_launcher:create

If you name your configuration file something other than icons_launcher.yaml or pubspec.yaml you will need to specify the name of the file when running the package.

flutter pub get
flutter pub run icons_launcher:create --path <your config file name here>

NOTE: If you are not using the existing pubspec.yaml your config file must still be located in the same directory as it.

If you encounter any issues please report them here.

In the above configuration, the package is setup to replace the existing launcher icons in both the Android and iOS project.


Attributes

Shown below is the full list of attributes which you can specify within your Icons Launcher configuration.

Icons Launcher OptionTypeDefaultDescription
image_pathStringnullThe image file path
platformsObjectnullUse for specific platform to generate icons

Platforms OptionTypeDefaultDescription
androidObjectnullUse for specific android platform
iosObjectnullUse for specific android platform
macosObjectnullUse for specific android platform
windowsObjectnullUse for specific android platform
webObjectnullUse for specific android platform
linuxObjectnullUse for specific android platform
Android OptionTypeDefaultDescription
enableBooleanfalseUse for enable android platform
image_pathStringnullThe image file path
adaptive_background_colorStringnullColor for fill out the background of the adaptive icon ("#ffffff")
adaptive_background_imageStringnullImage for fill out the background of the adaptive icon
adaptive_foreground_imageStringnullImage for the icon foreground of the adaptive icon
adaptive_round_imageStringnullImage for the round icon of the adaptive icon (optional)
IOS OptionTypeDefaultDescription
enableBooleanfalseUse for enable ios platform
image_pathStringnullThe image file path
Web OptionTypeDefaultDescription
enableBooleanfalseUse for enable ios platform
image_pathStringnullThe image file path
favicon_pathStringnullThe image file path
macOS OptionTypeDefaultDescription
enableBooleanfalseUse for enable macos platform
image_pathStringnullThe image file path
Windows OptionTypeDefaultDescription
enableBooleanfalseUse for enable windows platform
image_pathStringnullThe image file path
Linux OptionTypeDefaultDescription
enableBooleanfalseUse for enable linux platform
image_pathStringnullThe image file path

Flavor support

Create a Icons Launcher configuration file for your flavor. The config file is called icons_launcher-<flavor>.yaml by replacing <flavor> by the name of your desired flavor.

Example: icons_launcher-dev.yaml

Run with flavor:

flutter pub get
flutter pub run icons_launcher:create --flavor dev

The configuration file format is the same.


Example

Use in pubspec.yaml

dev_dependencies:
  icons_launcher: ^2.0.0

icons_launcher:
  image_path: 'assets/ic_logo_border.png'
  platforms:
    android:
      enable: true
      image_path: 'assets/ic_logo_border.png'
      # adaptive_background_color: '#ffffff'
      adaptive_background_image: 'assets/ic_background.png'
      adaptive_foreground_image: 'assets/ic_foreground.png'
      adaptive_round_image: 'assets/ic_logo_round.png'
    ios:
      enable: true
      image_path: 'assets/ic_logo_rectangle.png'
    web:
      enable: true
      image_path: 'assets/ic_logo_border.png'
      favicon_path: 'assets/ic_logo_round.png'
    macos:
      enable: false
      image_path: 'assets/ic_logo_border.png'
    windows:
      enable: false
      image_path: 'assets/ic_logo_border.png'
    linux:
      enable: false
      image_path: 'assets/ic_logo_border.png'

Or use in custom yaml (icons_launcher.yaml)

icons_launcher:
  image_path: 'assets/ic_logo_border.png'
  platforms:
    android:
      enable: true
      image_path: 'assets/ic_logo_border.png'
      # adaptive_background_color: '#ffffff'
      adaptive_background_image: 'assets/ic_background.png'
      adaptive_foreground_image: 'assets/ic_foreground.png'
      adaptive_round_image: 'assets/ic_logo_round.png'
    ios:
      enable: true
      image_path: 'assets/ic_logo_rectangle.png'
    web:
      enable: true
      image_path: 'assets/ic_logo_border.png'
      favicon_path: 'assets/ic_logo_round.png'
    macos:
      enable: false
      image_path: 'assets/ic_logo_border.png'
    windows:
      enable: false
      image_path: 'assets/ic_logo_border.png'
    linux:
      enable: false
      image_path: 'assets/ic_logo_border.png'

Libraries

cli_logger
constants
icon
icons_launcher_cli
template
utils