flutter_launcher_icons 0.5.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 97

Build Status

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.

✨ What's New

Version 0.5.0 (12th June 2018)

  • [Android] Support for adaptive icons added (Thanks to PR #28 - Thank you!)
Version 0.4.0 (8th June 2018)
  • Now possible to generate icons for each platform with different image paths - one for iOS icon and a separate one for Android (Thanks to PR #27 - Thank you!)

🔍 Guide

  1. Add dependency to your Flutter project's pubspec.yaml below any existing dependencies
dev_dependencies: 
  flutter_test:
    sdk: flutter
    
  flutter_launcher_icons: "^0.5.2"
  1. Within the same pubspec.yaml file, add flutter_icons config section.

Unlike your Flutter projects, you do not need to add your launcher icon images into the assets section of the pubspec.yaml.

dev_dependencies: 
  flutter_test:
    sdk: flutter
    
  flutter_launcher_icons: "^0.5.2"
  
flutter_icons:
  android: true 
  ios: "Example-Icon"
  image_path: "assets/icon/icon.png"
  image_path_android: "assets/icon/icon_android.png"
  image_path_ios: "assets/icon/icon_ios.png"
  adaptive_icon_background: "#FFFAFAFA"
  adaptive_icon_foreground: "assets/icon/icon-foreground.png"

Attributes:

android/ios

- True: Override the default existing Flutter launcher icon for the platform specified
- False: Ignore making launcher icons for this platform
- "Your Icon Name Here": 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)


ADAPTIVE ICONS

The next two attributes are only necessary if you want to have an adaptive icon for the Android app of your Flutter project.


adaptive_icon_background

- The color 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
  1. Run the command to generate the icons
flutter pub get
flutter pub pub run flutter_launcher_icons:main

👀 Example

Video Example

Note: This is showing v0.0.5.

Special thanks

  • Thanks to Brendan Duncan for the underlying image package to transform the pics.
  • Big thank you to all the contributors to the project. Every PR / reported issue is greatly appreciated!

Changelog

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.

example/lib/main.dart

import 'package:flutter/material.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or press Run > Flutter Hot Reload in IntelliJ). Notice that the
        // counter didn't reset back to zero; the application is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: new MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return new Scaffold(
      appBar: new AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: new Text(widget.title),
      ),
      body: new Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: new Column(
          // Column is also layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug paint" (press "p" in the console where you ran
          // "flutter run", or select "Toggle Debug Paint" from the Flutter tool
          // window in IntelliJ) to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            new Text(
              'You have pushed the button this many times:',
            ),
            new Text(
              '$_counter',
              style: Theme.of(context).textTheme.display1,
            ),
          ],
        ),
      ),
      floatingActionButton: new FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: new Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_launcher_icons: "^0.5.2"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


      import 'package:flutter_launcher_icons/android.dart';

      import 'package:flutter_launcher_icons/ios.dart';

      import 'package:flutter_launcher_icons/main.dart';

      import 'package:flutter_launcher_icons/xml_templates.dart';
  
Version Uploaded Documentation Archive
0.5.2 Jun 19, 2018 Go to the documentation of flutter_launcher_icons 0.5.2 Download flutter_launcher_icons 0.5.2 archive
0.5.1 Jun 18, 2018 Go to the documentation of flutter_launcher_icons 0.5.1 Download flutter_launcher_icons 0.5.1 archive
0.5.0 Jun 12, 2018 Go to the documentation of flutter_launcher_icons 0.5.0 Download flutter_launcher_icons 0.5.0 archive
0.4.0 Jun 8, 2018 Go to the documentation of flutter_launcher_icons 0.4.0 Download flutter_launcher_icons 0.4.0 archive
0.3.3 May 28, 2018 Go to the documentation of flutter_launcher_icons 0.3.3 Download flutter_launcher_icons 0.3.3 archive
0.3.2 May 2, 2018 Go to the documentation of flutter_launcher_icons 0.3.2 Download flutter_launcher_icons 0.3.2 archive
0.3.1 May 1, 2018 Go to the documentation of flutter_launcher_icons 0.3.1 Download flutter_launcher_icons 0.3.1 archive
0.3.0 May 1, 2018 Go to the documentation of flutter_launcher_icons 0.3.0 Download flutter_launcher_icons 0.3.0 archive
0.2.1 Apr 25, 2018 Go to the documentation of flutter_launcher_icons 0.2.1 Download flutter_launcher_icons 0.2.1 archive
0.2.0 Jan 24, 2018 Go to the documentation of flutter_launcher_icons 0.2.0 Download flutter_launcher_icons 0.2.0 archive

All 16 versions...

Analysis

We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
93 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
97
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

Primary library: package:flutter_launcher_icons/main.dart with components: io.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • The description is too long.

    Search engines will display only the first part of the description. Try to keep it under 180 characters.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 hint.

    Strong-mode analysis of lib/main.dart gave the following hint:

    line: 46 col: 1
    This function declares a return type of 'String', but doesn't end with a return statement.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.49.0 <3.0.0
dart_config ^0.5.0 0.5.0
image ^2.0.0 2.0.4
Transitive dependencies
archive 2.0.0
args 1.4.3
charcode 1.1.1
collection 1.14.10
convert 2.0.1
crypto 2.0.5
matcher 0.12.3
path 1.6.1
petitparser 1.7.6
source_span 1.4.0
stack_trace 1.9.2
string_scanner 1.0.2
typed_data 1.1.5
unittest 0.11.7 0.12.4+1
xml 3.0.0
yaml 2.1.14
Dev dependencies
test >=0.12.30 <1.0.0