Skip to main content

Tool to update all app icons in flutter project

Project description

flutter_logo_updater

Tool to update all app icons in flutter project

Installing:

pip install flutter_logo_updater

Using:

flutter_logo_updater logo_file_path project_file_path

Exmple:

caojianfeng$ flutter_logo_updater msks/images/logo_lxb.png  msks

==================================================
PROJECT LOGO Updating...
        In /Users/caojianfeng/Documents/w/msks
        With /Users/caojianfeng/Documents/w/msks/images/logo_lxb.png

--------------------------------------------------
[01/20]->(48*48)        /Users/caojianfeng/Documents/w/msks/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
[02/20]->(72*72)        /Users/caojianfeng/Documents/w/msks/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
[03/20]->(96*96)        /Users/caojianfeng/Documents/w/msks/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
[04/20]->(144*144)      /Users/caojianfeng/Documents/w/msks/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
[05/20]->(192*192)      /Users/caojianfeng/Documents/w/msks/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
[06/20]->(20*20)        /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
[07/20]->(29*29)        /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
[08/20]->(40*40)        /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
[09/20]->(40*40)        /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
[10/20]->(58*58)        /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
[11/20]->(60*60)        /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
[12/20]->(76*76)        /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
[13/20]->(80*80)        /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
[14/20]->(87*87)        /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
[15/20]->(120*120)      /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
[16/20]->(120*120)      /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
[17/20]->(152*152)      /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
[18/20]->(167*167)      /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
[19/20]->(180*180)      /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
[20/20]->(1024*1024)    /Users/caojianfeng/Documents/w/msks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
==================================================

Updated screen shot

How does it work:

1. Find a config

Find a config from your_flutter_project/flutter_logo_updater.json (TODO)

If no config found a default cfg while be use.

{
    "ios": {
        "appiconset": "ios/Runner/Assets.xcassets/AppIcon.appiconset"
    },
    "android": {
        "manifest": "android/app/src/main/AndroidManifest.xml"
    }
}

2. Find icon infos

To kown which png shoud be replaced.

2.1 On iOS

2.1.1 Find icons by the AppIcon.appiconset/Contents.json
2.1.2 Get the image_filename and size info from the json.
{
  "images" : [
        {
            "size" : "20x20",
            "idiom" : "iphone",
            "filename" : "Icon-App-20x20@2x.png",
            "scale" : "2x"
        },
        {
            "..."
        }
    ]
}

2.2 On Android

2.2.1 Find the android:icon prop of manifest/application from AndroidManifest.xml

<manifest>
    <application
        android:icon="@mipmap/ic_launcher">
        <!-- ... -->
    </application>
</manifest>
2.2.2 Parse base_dir from android:icon

So flutter_logo_updater kown which dir to search, mipmap or drawble.

2.2.3 Search png files and read their size.

3. Resize you logo(1024*1024) to sizes of the icons and replace them.

4. TODO

  1. Find a config from your_flutter_project/flutter_logo_updater.json
  2. Cut down size of the icons by pngquant

中文文档

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flutter_logo_updater-0.0.4.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

flutter_logo_updater-0.0.4-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file flutter_logo_updater-0.0.4.tar.gz.

File metadata

  • Download URL: flutter_logo_updater-0.0.4.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.4

File hashes

Hashes for flutter_logo_updater-0.0.4.tar.gz
Algorithm Hash digest
SHA256 d8225b951fb1ba2ed7383454f075dba7a717a52c073f7eaaf508396711c55143
MD5 a8fc256ae7beaf72bfd4a7a60dc2461c
BLAKE2b-256 2da61059dadb660b013e2af76ff379dc679a929c21a7ed14491226cb8ff9b453

See more details on using hashes here.

File details

Details for the file flutter_logo_updater-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: flutter_logo_updater-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.7.4

File hashes

Hashes for flutter_logo_updater-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 25191eb0192e2bbe6c32659f8ecddae4516d891dbebf28d34167dd19a2f6face
MD5 e16c8e5102c2240b321dcc4545dbc9f9
BLAKE2b-256 f2f38541c4c6b555f112c529bd69da12e60e532f02bde139c0d444e8c984fe78

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page