搜索插件、代码仓与 APP 分类

icons_launcher 封面
插件详情v3.1.0

icons_launcher

一个命令行工具,可简化更新 Flutter 应用启动图标的工作。

AndroidiOSmacOSWindowsLinux
近 30 天下载
25.1万
喜欢数
1080
Pub 分数
160

安装插件

flutter pub add icons_launcher

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

icons_launcher 是一个命令行工具,旨在简化 Flutter 应用程序中启动器图标更新的过程。它自动化了在 Android、iOS、macOS、Windows 和 Linux 等多个平台上生成和放置应用图标的工作。通过简化图标管理,该工具减少了手动操作,并确保在不同设备配置下保持一致性。该工具可通过 pub add 与 Flutter 项目无缝集成,使开发者能够轻松维护专业化的应用外观,而无需复杂的流程。

适合场景

  • 更新新版本的应用图标
  • 跨平台自动化图标生成
  • 在各种设备上保持品牌的一致性
  • 在设计更改后快速重新生成图标
  • 支持多平台应用程序部署

主要特点

  • 跨平台图标生成
  • 命令行界面集成
  • 自动资产文件夹更新
  • 支持各种图标大小和格式
  • 使用 flutter pub add 进行简单设置

适合对象

  • Flutter 开发人员管理应用品牌
  • 需要一致图标部署的团队
  • 针对多个操作系统的项目
  • 寻求节省时间的自动化工具的开发者

使用建议

  • 需要熟悉命令行
  • 可能需要手动验证生成的资产
  • 依赖于正确的输入图像尺寸
  • 不适用于实时图标编辑
  • 有限的GUI交互

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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


icons launcher preview

Platform Support
Android iOS macOS Web Linux Windows
✅ ✅ ✅ ✅ ✅ ✅

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.

Add config to pubspec.yaml or create a separate icons_launcher.yaml
icons_launcher:
  image_path: "assets/ic_logo_radius.png"
  platforms:
    android:
      enable: true
    ios:
      enable: true

Note For IOS 18 icons dark and tinted also supported. See more on example config below.

2. Run the package

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

flutter pub get
dart 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
dart 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 Option Type Default Description
image_path String null The image file path
platforms Object null Use for specific platforms to generate icons

Platforms Option Type Default Description
android Object null Use for specific Android platform
ios Object null Use for specific iOS platform
macos Object null Use for specific macOS platform
windows Object null Use for specific Windows platform
web Object null Use for specific Web platform
linux Object null Use for specific Linux platform
Android Option Type Default Description
enable Boolean false Use for enable Android platform
image_path String null The image file path
notification_image String null Image for the notification icon
adaptive_background_color String null Color for fill out the background of the adaptive icon
adaptive_background_image String null Image for fill out the background of the adaptive icon
adaptive_foreground_image String null Image for the icon foreground of the adaptive icon
adaptive_round_image String null Image for the round icon of the adaptive icon
adaptive_monochrome_image String null Image for the monochrome version of the adaptive icon
iOS Option Type Default Description
enable Boolean false Use for enable iOS platform
image_path String null The image file path
dark_path String null The dark image file path
tinted_path String null The tinted image file path
Web Option Type Default Description
enable Boolean false Use for enable Web platform
image_path String null The image file path
maskable_image_path String null The maskable image file path for PWA
favicon_path String null The image file path
favicon_output_extension String .png Extension for favicon .png or .ico
macOS Option Type Default Description
enable Boolean false Use for enable macOS platform
image_path String null The image file path
Windows Option Type Default Description
enable Boolean false Use for enable Windows platform
image_path String null The image file path
Linux Option Type Default Description
enable Boolean false Use for enable Linux platform with snapcraft
image_path String null The 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 and icons_launcher-prod.yaml

Run with flavor:

flutter pub get
# create for dev flavor
dart run icons_launcher:create --flavor dev

# create for prod flavor
dart run icons_launcher:create --flavor prod

Alternatively, you can run multiple flavors at the same time with the following command:

dart run icons_launcher:create --flavors dev,prod

The configuration file format is the same.


Example

icons_launcher:
  platforms:
    android:
      enable: true
      image_path: "assets/ic_logo_radius.png"
      notification_image: "assets/ic_foreground.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"
      adaptive_monochrome_image: "assets/ic_black_white.png"
    ios:
      enable: true
      image_path: "assets/ic_logo_rectangle_light.png"
      # For iOS 18+ (support dark and tinted)
      dark_path: "assets/ic_logo_rectangle_dark.png"
      tinted_path: "assets/ic_logo_rectangle_tinted.png"
    web:
      enable: false
      image_path: "assets/ic_logo_rectangle_light.png"
      maskable_image_path: "assets/ic_logo_radius.png"
      favicon_path: "assets/ic_logo_round.png"
      # favicon_output_extension: ".ico"
    macos:
      enable: false
      image_path: "assets/macos_icon.png"
    windows:
      enable: false
      image_path: "assets/ic_logo_radius.png"
    linux:
      enable: false
      image_path: "assets/ic_logo_radius.png"

Activities

Alt

所属分类

依赖

依赖清单 5 项

源码仓库

使用此插件的项目

所在榜单