images_keys 0.0.2 copy "images_keys: ^0.0.2" to clipboard
images_keys: ^0.0.2 copied to clipboard

outdated

A simple and easy command-line generation tool generating image assets keys for Dart and Flutter projects.

A simple and easy command-line generation tool generating image assets keys for Dart and Flutter projects. Inspired by easy_localization:generate.

Getting Started #

Motivation #

In Flutter you need use asset path string directly:

Image.asset('assets/images/image.png')

You trust the human factor to validate the path correctness to the asset. It is not safe. If you get wrong you know it later in runtime only.

The safe way to pass it to generation tool:

Image.asset(ImagesKeys.image_png)

Installation #

Add to your pubspec.yaml:

dependencies:
  images_keys: <last_version>

Usage #

You can simply get information about command line arguments. Open terminal in your project path and run command:

pub run images_keys:images_keys -h

for flutter:

flutter pub run images_keys:images_keys -h

Command line arguments #

Arguments Short Default Description
--help -h Help info
--source-dir -S assets/images Folder containing image files
--output-dir -O lib/generated Output folder stores for the generated file
--output-file -o images_keys.images_keys.dart Output file name

See example for more details.

1
likes
0
pub points
39%
popularity

Publisher

unverified uploader

A simple and easy command-line generation tool generating image assets keys for Dart and Flutter projects.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

args, path

More

Packages that depend on images_keys