flutter_launcher_icons
v0.14.4A package which simplifies the task of updating your Flutter app's launcher icon.
Архив пакета: https://pubdev.letsnova.ru/api/archives/flutter_launcher_icons/0.14.4.tar.gz
dart pub add flutter_launcher_iconsREADME
Flutter Launcher Icons
A command-line tool which simplifies the task of updating your Flutter app's launcher icon. Fully flexible, allowing you to choose what platform you wish to update the launcher icon for and if you want, the option to keep your old launcher icon in case you want to revert back sometime in the future.
:book: Guide
1. Setup the config file
Run the following command to create a new config automatically:
dart run flutter_launcher_icons:generate
This will create a new file called flutter_launcher_icons.yaml in your flutter project's root directory.
If you want to override the default location or name of the config file, use the -f flag:
dart run flutter_launcher_icons:generate -f <your config file name here>
To override an existing config file, use the -o flag:
dart run flutter_launcher_icons:generate -o
OR
Add your Flutter Launcher Icons configuration to your pubspec.yaml.
An example is shown below. More complex examples can be found in the example projects.
dev_dependencies:
flutter_launcher_icons: "^0.14.4"
flutter_launcher_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
min_sdk_android: 21 # android min sdk min:16, default 21
web:
generate: true
image_path: "path/to/image.png"
background_color: "#hexcode"
theme_color: "#hexcode"
windows:
generate: true
image_path: "path/to/image.png"
icon_size: 48 # min:48, max:256, default: 48
macos:
generate: true
image_path: "path/to/image.png"
2. Run the package
After setting up the configuration, all that is left to do is run the package.
flutter pub get
dart run flutter_launcher_icons
If you name your configuration file something other than flutter_launcher_icons.yaml or pubspec.yaml you will need to specify
the name of the file when running the package.
flutter pub get
dart run flutter_launcher_icons -f <your config file name here>
Note: If you are not using the existing pubspec.yaml ensure that your config file is 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 with the icon located in the image path specified above and given the name "launcher_icon" in the Android project and "Example-Icon" in the iOS project.
:mag: Attributes
Shown below is the full list of attributes which you can specify within your Flutter Launcher Icons configuration.
Global
image_path: The location of the icon image file which you want to use as the app launcher icon.
Android
-
androidtrue: Override the default existing Flutter launcher icon for the platform specifiedfalse: Ignore making launcher icons for this platformicon/path/here.png: This will generate a new launcher icons for the platform with the name you specify, without removing the old default existing Flutter launcher icon.
-
image_path_android: The location of the icon image file specific for Android platform (optional - if not defined then the image_path is used) -
min_sdk_android: Specify android min sdk value The next two attributes are only used when generating Android launcher icon -
adaptive_icon_background: The color (E.g."#ffffff") or image asset (E.g."assets/images/christmas-background.png") which will be used to fill out the background of the adaptive icon. -
adaptive_icon_foreground: The image asset which will be used for the icon foreground of the adaptive icon Note: Adaptive Icons will only be generated when both adaptive_icon_background and adaptive_icon_foreground are specified. (the image_path is not automatically taken as foreground) -
adaptive_icon_foreground_inset: This is used to add padding (in %) to the foreground icon when generating an adaptive icon. The default value is16. -
adaptive_icon_monochrome: The image asset which will be used for the icon foreground of the Android 13+ themed icon. For more information see Android Adaptive Icons
IOS
iostrue: Override the default existing Flutter launcher icon for the platform specifiedfalse: Ignore making launcher icons for this platformicon/path/here.png: This will generate a new launcher icons for the platform with the name you specify, without removing the old default existing Flutter launcher icon.
image_path_ios: The location of the icon image file specific for iOS platform (optional - if not defined then the image_path is used)remove_alpha_ios: Removes alpha channel for IOS iconsimage_path_ios_dark_transparent: The location of the dark mode icon image file specific for iOS 18+ platform. Note: Apple recommends this icon to be transparent. For more information see Apple Human Interface Guidelines for App Iconsimage_path_ios_tinted_grayscale: The location of the tinted mode icon image file specific for iOS 18+ platform. Note: This icon should be an grayscale image. Usedesaturate_tinted_to_grayscale_ios: trueto automatically desaturate the image provided here.desaturate_tinted_to_grayscale_ios: Automatically desaturates tinted mode icon image to grayscale, defaults to falsebackground_color_ios: The color (in the format "#RRGGBB") to be used as the background when removing the alpha channel. It is used only when theremove_alpha_iosproperty is set to true. (optional - if not defined then#ffffffis used)
Web
web: Add web related configsgenerate: Specifies whether to generate icons for this platform or notimage_path: Path to web icon.pngbackground_color: Updates background_color inweb/manifest.jsontheme_color: Updates theme_color inweb/manifest.json
Windows
windows: Add Windows related configsgenerate: Specifies whether to generate icons for Windows platform or notimage_path: Path to windows icon.pngicon_size: Windows app icon size. Icon size should be within this constrains 48<=icon_size<=256, defaults to 48
MacOS
macos: Add MacOS related configsgenerate: Specifies whether to generate icons for MacOS platform or notimage_path: Path to macos icon.png file
Note: iOS icons should fill the entire image and not contain transparent borders.
Flavor support
Create a Flutter Launcher Icons configuration file for your flavor. The config file is called flutter_launcher_icons-<flavor>.yaml by replacing <flavor> by the name of your desired flavor.
The configuration file format is the same.
An example project with flavor support enabled has been added to the examples.
:question: Troubleshooting
Listed a couple common issues with solutions for them
Generated icon color is different from the original icon
Caused by an update to the image dependency which is used by Flutter Launcher Icons.
Use #AARRGGBB for colors instead of #AABBGGRR, to be compatible with Flutter image class.
Dependency incompatible
You may receive a message similar to the following
Because flutter_launcher_icons >=0.9.0 depends on args 2.0.0 and flutter_native_splash 1.2.0 depends on args ^2.1.1, flutter_launcher_icons >=0.9.0 is incompatible with flutter_native_splash 1.2.0.
And because no versions of flutter_native_splash match >1.2.0 <2.0.0, flutter_launcher_icons >=0.9.0 is incompatible with flutter_native_splash ^1.2.0.
So, because enstack depends on both flutter_native_splash ^1.2.0 and flutter_launcher_icons ^0.9.0, version solving failed.
pub get failed (1; So, because enstack depends on both flutter_native_splash ^1.2.0 and flutter_launcher_icons ^0.9.0, version solving failed.)
For a quick fix, you can temporarily override all references to a dependency: See here for an example.
:eyes: Example
Note: This is showing a very old version (v0.0.5)
Special thanks
- Thanks to Brendan Duncan for the underlying image package to transform the icons.
- Big thank you to all the contributors to the project. Every PR / reported issue is greatly appreciated!
История изменений
Changelog
0.14.4 (10th June 2025)
- Removed rules which no longer exist from analysis_options #598
- Fix template generated within thegenerate command #642
- Standardize on async I/O and waiting for work to complete #646
0.14.3 (17th January 2025)
- Android: Avoids creating mipmap file used by adaptive and monochrome icons if no config exist for both #601
0.14.2 (5th December 2024)
- iOS: Fixed issue where dark and tinted icons were placed into the wrong directory #597
0.14.1 (24th September 2024)
- Fixed README
0.14.0 (21st September 2024)
- Android: Support for monochrome icons #497
Before
Now
- Android: Ability to set inset for adaptive icon foreground and monochrome icon #563
- iOS: Dark and Tinted icons for iOS 18+ #569
0.13.1 (15th April 2023)
- Can now use
flutter_launcher_iconsinstead offlutter_icons#478 - Can use command
flutter pub run flutter_launcher_icons:generateto automatically generate config file #475
0.13.0 (7th April 2023)
0.12.0 (24th February 2023)
- Updated image package and other packages #447
0.11.0 (27th September 2022)
- Support for Macos Icons #407
- Cli-improvement #400
- Add
repositoryandissue_tracker#411 (thanks to @patelpathik) - Fix indent in web/manifest.json #407
- Fix the icons 50 and 57 in
contents.json#412 (thanks to @adnanjpg) - Fix typos #405 (thanks to @edwardmp)
- Added newline to EOF #325 (thanks to @sandersaelmans)
0.10.0 (2nd August 2022)
- Support for Web Icons #374
- Support for Windows Icons #382
- Added missing IOS icon sizes #298
- Added
min_sdk_androidoption #392 - Added documentation for
remove_alpha_ios#392 - Fixed issue with loading config from
pubspec.yaml#398 (thanks to @p-mazhnik)
0.9.3 (6th June 2022)
- Fixes to make sure it works for Flutter v2.8 (thanks to @RatakondalaArun)
- Fixed issue with incorrect version being shown
0.9.2 (22nd August 2021)
- Fixed issue where success message printed even when exception occured (thanks to @happy-san)
0.9.1 (25th July 2021)
- Upgrade args dependency to ^2.1.1 (thanks to @PiN73 and @comlaterra)
- Upgraded
imageandtestdependencies
0.9.0 (28th Feb 2021)
- Null-safety support added (thanks to @SteveAlexander)
- Added option to remove alpha channel for iOS icons (thanks to @SimonIT)
0.8.1 (2nd Oct 2020)
- Fixed flavor support on windows (@slightfoot)
0.8.0 (12th Sept 2020)
- Added flavours support (thanks to @sestegra & @jorgecoca)
- Removed unassigned iOS icons (thanks to @melvinsalas)
- Fixing formatting (thanks to @mreichelt)
0.7.5 (24th April 2020)
- Fixed issue where new lines were added to Android manifest (thanks to @mreichelt)
- Improvements to code quality and general tidying up (thanks to @connectety)
- Fixed Android example project not running (needed to be migrated to AndroidX)
0.7.4 (28th Oct 2019)
- Worked on suggestions from pub.dev
0.7.3 (3rd Sept 2019)
- Lot of refactoring and improving code quality (thanks to @connectety)
- Added correct App Store icon settings (thanks to @richgoldmd)
0.7.2 (25th May 2019)
- Reverted back using old interpolation method
0.7.1 (24th May 2019)
- Fixed issue with image dependency not working on latest version of Flutter (thanks to @sboutet06)
- Fixed iOS icon sizes which were incorrect (thanks to @sestegra)
- Removed dart_config git dependency and replaced with yaml dependency
- Refactoring of code
0.7.0 (22nd November 2018)
- Now ensuring that the Android file name is valid - An error will be thrown if it doesn't meet the criteria
- Fixed issue where there was a git diff when there was no change
- Fixed issue where iOS icon would be generated when it shouldn't be
- Added support for drawables to be used for adaptive icon backgrounds
- Added support for Flutter Launcher Icons to be able to run with it's own config file (no longer necessary to add to pubspec.yaml)
0.6.1 (26th August 2018)
- Upgraded test package
- Due to issue with dart_config not working with Dart 2.1.0, now using forked version of dart_config which contains fixes from both @v3rm0n and @SPodjasek
0.6.0 (8th August 2018)
- Moved the package to Flutter Community
0.5.2 (19th June 2018)
- Previous release didn't fix adaptive icons, just prevented the error message from appearing. This should hopefully fix it!
0.5.1 (18th June 2018)
- Fix for adaptive icons
0.5.0 (12th June 2018)
- [Android] Support for adaptive icons added (Suggestion #23)
0.4.0 (9th June 2018)
- Now possible to generate icons for each platform with different image paths (one for iOS icon and a separate one for Android)
0.3.3 (28th May 2018)
- Upgraded dart image package dependency to 2.0.0 (issue #26)
0.3.2 (2nd May 2018)
- Bug fixing
0.3.1 (1st May 2018)
- Bug fixing
0.3.0 (1st May 2018)
- Fixed issue where icons produced weren't the correct size (Due to images not with a 1:1 aspect r ation)
- Improved quality of smaller icons produced (Thanks to PR #17 - Thank you!)
- Updated console printed messages to keep them consistent
- Added example folder to GitHub project
0.2.1 (25th April 2018)
- Added extra iOS icon size (1024x1024)
- Fixed iOS default icon name (Thanks to PR #15 - Thank you!)
- Fixed issue #10 where creation of the icons was failing due to the target folder not existing
0.2.0 (18th January 2018)
- Ability to create new launcher icons without replacing the old ones added (#6)
- Fixed issue with launcher icons for iOS not correctly being set
0.0.5
- Quick Fix on if statement
0.0.4
- Fixing strong mode error
0.0.3
- Adding flutter as a dependency so its listed as a flutter package.
0.0.2
- Fix Doc typo
0.0.1
- Initial version, Resizes Icon to Android sizes only.

