flutter-asset-converter is a shell script which aim to help with @2x, @3x, etc. naming convention for images.
Most design tools export assets with @2x, @3x naming convention, but flutter uses folders named 2.0x, 3.0x instead.
With this script you can restructure and rename folders containing assets with @Nx postfixes and use them with flutter.
VERSION: 1.0.0 USAGE: ./flutter-asset-converter.sh ~/assets DESCRIPTION: This script aim to rename assets exported in @2x, @3x, etc. naming convention to flutter asset convention. - assets - the asset-folder, containing n sub folders with following asset-structure: - asset1 - vector.png - [email protected] - [email protected] - asset2 - vector.png - [email protected] - [email protected] - ... AUTHOR: Rafael M. EXAMPLE: ./flutter-asset-converter.sh ~/Development/Project/Assets/Export
๐จ Note: bare script -> no error check or anything fancy yet -> use at own risk ๐จ
-
Clone
git clone https://github.com/rafaelmaeuer/flutter-asset-converter cd flutter-asset-converter chmod +x flutter-asset-converter.sh
-
Run
device:flutter-asset-converter$ ./flutter-asset-converter ~/assets start process asset1 process asset2 process asset3 process asset4 process asset5 done
- Flutter - Declaring resolution-aware image assets
- Github - Support for @2x, @3x, etc naming convention for images
This script follow MIT license.