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.
Add your Flutter Launcher Icons configuration to your
pubspec.yaml or create a new config file called
An example is shown below. A more complex example can be found in the example project.
dev_dependencies: flutter_launcher_icons: "^0.7.0" flutter_icons: android: "launcher_icon" ios: true image_path: "assets/icon/icon.png"
If you name your configuration file something other than
pubspec.yaml you will need to specify
the name of the file when running the package.
flutter packages get flutter packages pub run flutter_launcher_icons: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.
After setting up the configuration, all that is left to do is run the package.
flutter packages get flutter packages pub run flutter_launcher_icons:main
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.
Shown below is the full list of attributes which you can specify within your Flutter Launcher Icons configuration.
true: Override the default existing Flutter launcher icon for the platform specified
false: Ignore making launcher icons for this platform
icon/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: The location of the icon image file which you want to use as the app 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)
image_path_ios: The location of the icon image file specific for iOS platform (optional - if not defined then the image_path is used)
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: This is showing a very old version (v0.0.5)
This project has been setup so that you can test out the package before adding it to your own project. It is also a great way for contributors to the project can quickly test their changes to the project before they are published for everyone to download.
Add this to your package's pubspec.yaml file:
dependencies: flutter_launcher_icons: ^0.7.0
You can install packages from the command line:
$ pub get
$ flutter packages get
Alternatively, your editor might support
pub get or
flutter packages get.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:flutter_launcher_icons/android.dart'; import 'package:flutter_launcher_icons/constants.dart'; import 'package:flutter_launcher_icons/custom_exceptions.dart'; import 'package:flutter_launcher_icons/ios.dart'; import 'package:flutter_launcher_icons/main.dart'; import 'package:flutter_launcher_icons/xml_templates.dart';
|0.7.0||Nov 22, 2018|
|0.6.1||Aug 26, 2018|
|0.6.0||Aug 7, 2018|
|0.5.2||Jun 19, 2018|
|0.5.1||Jun 18, 2018|
|0.5.0||Jun 12, 2018|
|0.4.0||Jun 8, 2018|
|0.3.3||May 28, 2018|
|0.3.2||May 2, 2018|
|0.3.1||May 1, 2018|
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
We analyzed this package on Apr 25, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, other
lib/android.dart. (-6.78 points)
lib/android.dart reported 14 hints, including:
line 48 col 1: Prefer using /// for doc comments.
line 79 col 1: Prefer using /// for doc comments.
line 102 col 1: Prefer using /// for doc comments.
line 144 col 1: Prefer using /// for doc comments.
line 155 col 1: Prefer using /// for doc comments.
lib/ios.dart. (-1 points)
lib/ios.dart reported 2 hints:
line 6 col 1: Prefer using /// for doc comments.
line 96 col 3:
Future results in
async function bodies must be
awaited or marked
lib/main.dart. (-0.50 points)
lib/main.dart reported 1 hint:
line 150 col 1: This function has a return type of 'bool', but doesn't end with a return statement.
Fix additional 3 files with analysis or formatting issues.
Additional issues in the following files:
Prefer published dependencies. (-100 points)
The source code in a
git repository is mutable and could disappear.
Use constrained dependencies. (-20 points)
pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies:
The description is too long. (-10 points)
Search engines display only the first part of the description. Try to keep the value of the
description field in your package's
pubspec.yaml file between 60 and 180 characters.
|Dart SDK||>=2.0.0-dev.49.0 <3.0.0|