flutter_asset_generator 0.4.2 copy "flutter_asset_generator: ^0.4.2" to clipboard
flutter_asset_generator: ^0.4.2 copied to clipboard

outdated

Automatically generate a resource file by scanning pubspec.yaml to correspond to the flutter's asset, imitation R file short name.

flutter_asset_generator #

Automatically generate the dart file for pubspec.yaml

The purpose of this library is to help flutter developers automatically generate asset corresponding dart files to help developers release their hands from this meaningless job, and the open source community has a lot of the same functionality.

This library is based on dartlang's build library.

中文文档

English

screenshot #

img

Usage #

use source #

add dart,pub to $PATH environment.

git clone https://github.com/CaiJingLong/flutter_resource_generator.git
cd flutter_resource_generator
pub get
dart bin/resource_generator.dart $flutter_project

pub global #

install:

pub global activate flutter_asset_generator

use:

fgen or fgen -s $flutter_project

Support options #

Use $ fgen -h or $ fgen --help see usage document.

fgen -h
-w, --[no-]watch    Continue to monitor changes after execution of orders.
                    (defaults to on)

-o, --output        Your resource file path.
                    If it's a relative path, the relative flutter root directory
                    (defaults to "lib/const/resource.dart")

-s, --src           Flutter project root path
                    (defaults to ".")

-h, --[no-]help     Help usage

File name #

Space, '.' and '-' in the path are converted to _.

convert filed name example:

images/1.png => IMAGES_PNG
images/hello_world.jpg => IMAGES_HELLO_WORLD_JPG
images/hello-world.jpg => IMAGES_HELLO_WORLD_JPG

Errors will occur in the following situations

  images/
    main_login.png
    main/
      login.png

Because the two field names will be exactly the same.

62
likes
0
pub points
87%
popularity

Publisher

verified publisherfluttercandies.com

Automatically generate a resource file by scanning pubspec.yaml to correspond to the flutter's asset, imitation R file short name.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

args, path, yaml

More

Packages that depend on flutter_asset_generator