flutter_gen icon indicating copy to clipboard operation
flutter_gen copied to clipboard

Select only some folders to generate assets

Open elianortega opened this issue 3 years ago • 7 comments

Is it possible to select only some folders and not all from assets/?

with this I mean overriding the default

flutter:
  assets:
    - ...

and tell flutter_gen to generate the assets only of some directories

elianortega avatar Oct 11 '21 18:10 elianortega

Hi @elianmortega Can you tell me what's your motivation here? Then we can consider adding this feature. 🙂

lcdsmao avatar Oct 14 '21 01:10 lcdsmao

In easy_localization I'm storing data as en-US.json . When generating I've same issues

[SEVERE] CheckedFromJsonException Could not create FlutterGen. There is a problem with "assets". type 'YamlList' is not a subtype of type 'Map<dynamic, dynamic>' in type cast [INFO] Reading cached asset graph completed, took 91ms

gokuldasvr avatar Oct 22 '21 05:10 gokuldasvr

@gokuldasvr It seems like a different problem. Please fire a new issue and attach your pubspec.yaml configuration.

lcdsmao avatar Oct 22 '21 06:10 lcdsmao

Please consider the following use-case:

assets/images/... -> should be generated
assets/data/... -> should not be generated

All files inside the data folder are simple data files, for example json or xml files. Which are used internally in the flutter application and therefore should not be considered as layout files (images, color, fonts etc.).

It would be great to have an exclude: property to defines those files or directories.

jayjah avatar Dec 04 '21 22:12 jayjah

Any updates on this?

Tkko avatar May 14 '22 18:05 Tkko

Is it possible to select only some folders and not all from assets/?

with this I mean overriding the default

flutter:
  assets:
    - ...

and tell flutter_gen to generate the assets only of some directories

You can generate flutter_gen files without specifying all your asset paths how ?

Aristidios avatar Jul 08 '22 13:07 Aristidios

Any updates?

linbiaojj avatar Jun 25 '23 03:06 linbiaojj

assets -> exclude has added to support the request.

AlexV525 avatar Mar 06 '24 23:03 AlexV525

Any updates?

dev-shvetsov avatar Mar 10 '24 20:03 dev-shvetsov