icons_launcher 1.0.1 icons_launcher: ^1.0.1 copied to clipboard
A package which simplifies the task of updating your Flutter app's icons launcher.
A command-line tool which simplifies the task of updating your Flutter app's icon launcher. Fully flexible, allowing you to choose what platform you wish to update the icon launcher for and if you want.
Want to see older changes? Be sure to check out the Changelog.
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: "^1.0.1"
flutter_icons:
android: true
ios: true
image_path: "assets/icon/icon.png"
Method 2: create icons_launcher.yaml at project root
flutter_icons:
android: true
ios: true
image_path: "assets/icon/icon.png"
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:main
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:main -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.
Attributes #
Shown below is the full list of attributes which you can specify within your Icons Launcher configuration.
-
android
/ios
/macos
/windows
/linux
true
: 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 icon launcher.
-
image_path
: The location of the icon image file which you want to use as the app icon launcher -
image_path_android
: The location of the icon image file specific for Android platform (optional - if not defined then the image_path is used) -
image_path_ios
: The location of the icon image file specific for iOS platform (optional - if not defined then the image_path is used) -
image_path_macos
: The location of the icon image file specific for MacOS platform (optional - if not defined then the image_path is used) -
image_path_windows
: The location of the icon image file specific for Windows platform (optional - if not defined then the image_path is used) -
image_path_linux
: The location of the icon image file specific for Linux platform (optional - if not defined then the image_path is used)
The next two attributes are only used when generating Android icon launcher
-
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: iOS icons should fill the entire image and not contain transparent borders.
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.
The configuration file format is the same.
Example #
Use in pubspec.yaml #
dev_dependencies:
icons_launcher: "^1.0.1"
flutter_icons:
image_path_android: "assets/images/icon-1024x1024.png"
image_path_ios: "assets/images/icon-1024x1024.png"
image_path_macos: 'assets/images/icon-710x599.png'
image_path_windows: 'assets/images/icon-710x599.png'
image_path_linux: 'assets/images/icon-710x599.png'
adaptive_icon_background: "assets/images/christmas-background.png"
adaptive_icon_foreground: "assets/images/icon-foreground-432x432.png"
android: true
ios: true
remove_alpha_ios: true
macos: true
remove_alpha_macos: true
windows: true
linux: true
Use in custom yaml (icons_launcher.yaml) #
flutter_icons:
image_path_android: "assets/images/icon-1024x1024.png"
image_path_ios: "assets/images/icon-1024x1024.png"
image_path_macos: 'assets/images/icon-710x599.png'
image_path_windows: 'assets/images/icon-710x599.png'
image_path_linux: 'assets/images/icon-710x599.png'
adaptive_icon_background: "assets/images/christmas-background.png"
adaptive_icon_foreground: "assets/images/icon-foreground-432x432.png"
android: true
ios: true
remove_alpha_ios: true
macos: true
remove_alpha_macos: true
windows: true
linux: true