• Stars
    star
    1,921
  • Rank 23,160 (Top 0.5 %)
  • Language
    Dart
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Flutter Launcher Icons - A package 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. Maintainer: @MarkOSullivan94

Flutter Launcher Icons

Flutter Community: flutter_launcher_icons

pub package

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.

📖 Guide

1. Setup the config file

Run the following command to create a new config automatically:

flutter pub 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:

flutter pub run flutter_launcher_icons:generate -f <your config file name here>

To override an existing config file, use the -o flag:

flutter pub 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.13.1"

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
flutter pub 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
flutter pub 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.

🔍 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

  • android

    • 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)

  • 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_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

  • ios
    • 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_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 icons
  • background_color_ios: The color (in the format "#RRGGBB") to be used as the background when removing the alpha channel. It is used only when the remove_alpha_ios property is set to true. (optional - if not defined then #ffffff is used)

Web

  • web: Add web related configs
    • generate: Specifies whether to generate icons for this platform or not
    • image_path: Path to web icon.png
    • background_color: Updates background_color in web/manifest.json
    • theme_color: Updates theme_color in web/manifest.json

Windows

  • windows: Add Windows related configs
    • generate: Specifies whether to generate icons for Windows platform or not
    • image_path: Path to web icon.png
    • icon_size: Windows app icon size. Icon size should be within this constrains 48<=icon_size<=256, defaults to 48

MacOS

  • macos: Add MacOS related configs
    • generate: Specifies whether to generate icons for MacOS platform or not
    • image_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.

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

Related issue

Image foreground is too big / too small

For best results try and use a foreground image which has padding much like the one in the example.

Related issue

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.

👀 Example

Video 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!

More Repositories

1

chewie

The video player for Flutter with a heart of gold
Dart
1,865
star
2

community

Flutter Community - A central place for community made Flutter content.
1,505
star
3

flutter_webview_plugin

Community WebView Plugin - Allows Flutter to communicate with a native WebView.
Java
1,465
star
4

plus_plugins

Flutter Community Plus Plugins
Dart
1,441
star
5

get_it

Get It - Simple direct Service Locator that allows to decouple the interface from a concrete implementation and to access the concrete implementation from everywhere in your App. Maintainer: @escamoteur
Dart
1,245
star
6

flutter_sticky_headers

Flutter Sticky Headers - Lets you place "sticky headers" into any scrollable content in your Flutter app. No special wrappers or magic required. Maintainer: @slightfoot
Dart
1,041
star
7

flutter_downloader

Flutter Downloader - A plugin for creating and managing download tasks.
Kotlin
884
star
8

font_awesome_flutter

The Font Awesome Icon pack available as Flutter Icons
Dart
812
star
9

flutter_workmanager

A Flutter plugin which allows you to execute code in the background on Android and iOS.
Dart
802
star
10

redux.dart

Redux for Dart
Dart
514
star
11

flutter_blurhash

Compact representation of a placeholder for an image. Encode a blurry image under 30 caracters for instant display like used by Medium. Maintainer: @Solido
Dart
486
star
12

flutter_after_layout

Flutter After Layout - Brings functionality to execute code after the first layout of a widget has been performed, i.e. after the first frame has been displayed. Maintainer: @slightfoot
Dart
462
star
13

flutter-draggable-scrollbar

Draggable Scrollbar - A scrollbar that can be dragged for quickly navigation through a vertical list. Additional option is showing label next to scrollthumb with information about current item. Maintainer: @marica27
Dart
440
star
14

responsive_scaffold

Responsive Scaffold - On mobile it shows a list and pushes to details and on tablet it shows the List and the selected item. Maintainer: @rodydavis
Dart
359
star
15

app_review

App Review - Request and Write Reviews and Open Store Listing for Android and iOS in Flutter. Maintainer: @rodydavis
Dart
314
star
16

flutter_infinite_listview

Flutter Infinite ListView - ListView with items that can be scrolled infinitely in both directions. Maintainer: @slightfoot
Dart
305
star
17

backdrop

Backdrop implementation in flutter.
Dart
305
star
18

flutter_google_places

Google Places - Google places autocomplete widgets for flutter. No wrapper, use https://pub.dev/packages/google_maps_webservice. Maintainer: @juliansteenbakker
Dart
294
star
19

flutter_sms

A Flutter plugin to Send SMS and MMS on iOS and Android. If iMessage is enabled it will send as iMessage on iOS. This plugin must be tested on a real device on iOS. Maintainer: @rodydavis
Dart
232
star
20

flutter_uploader

background upload plugin for flutter
Dart
197
star
21

page_turn

Page Turn Widget - Add a page turn effect to widgets in your app. Maintainer: @rodydavis
Dart
191
star
22

import_sorter

🎯 Automatically organize your dart imports. Maintainer: @gleich
Dart
155
star
23

flutter_contacts

Contacts Service - A Flutter plugin to retrieve and manage contacts on Android and iOS devices. Maintainer: @lukasgit
Java
151
star
24

rx_command

RxCommand - Reactive event handler wrapper class inspired by ReactiveUI. Maintainer @escamoteur
Dart
134
star
25

flutter_wear_plugin

A plugin that offers widgets for Wear OS by Google
Dart
133
star
26

breakpoint

Breakpoint - A Flutter plugin to calculate the material design breakpoints. Maintainer: @rodydavis
Dart
108
star
27

get_version

Get Version - Get the Version Name, Version Code, Platform and OS Version, and App ID on iOS and Android. Maintainer: @rodydavis
Ruby
94
star
28

native_widgets

Native Widgets - A new Flutter package for using Android and iOS natively on each platform. Maintainer: @rodydavis
Dart
92
star
29

state_persistence

State Persistence - Persist state across app launches. By default this library store state as a local JSON file called `data.json` in the applications data directory. Maintainer: @slightfoot
Dart
73
star
30

persist_theme

Persist Theme - A flutter plugin for persisting the theme data. Support for Dark Modes. Maintainer @rodydavis
Dart
68
star
31

dart_sealed_unions

Sealed Unions for Dart. Maintainer: @nodinosaur
Dart
65
star
32

flutter-styleguide

Flutter Style Guide. Suggested styles and best practices for teams using Flutter.
49
star
33

firestore_helpers

Firestore Helpers - Firestore helper function to create dynamic and location based queries. Maintainer: @escamoteur
Dart
48
star
34

wakelock_plus

Flutter plugin that allows you to keep the device screen awake on Android, iOS, macOS, Windows, Linux, and web.
Dart
39
star
35

rocket_guide

An example project for #30DaysOfFlutter.
Dart
33
star
36

android_id

Maintainer: @nohli
Dart
30
star
37

admin_dashboard

Admin Dashboard - a Flutter Community Dashboard that assists admins by rounding up and providing the admins with information regarding issues, latest activities on repositories, maintainers, level of access and a trigger to build and deploy to pub. dev, and more. (Work In Progress)
Dart
23
star
38

arcgis_map_sdk

Flutter implementation of the ArcGis map framework by esri
Dart
10
star
39

redux_undo

Redux Undo - Make your redux store undo- and redoable. Inspired by the JS redux_undo package. Maintainer: @michelengelen
Dart
5
star
40

site

Website
Dart
4
star
41

interval_tree

A non-overlapping interval tree for Dart
Dart
3
star
42

transfer-guide

The official Flutter Community Transfer Guide for package maintainers wanting to transfer their package to the organization.
3
star
43

readme_generator

A Dart program that generates the README.md for the FlutterCommunity/community repo.
Dart
2
star
44

fluttercommunity.github.io

The Flutter Community website.
HTML
1
star