flutter_gen
flutter_gen copied to clipboard
[Feature Request] Autogenerate List with assets in class
We have around 50 icons in our app and we would like to autogenerate a value getter that returns a list of all the assets in the class
class $AssetsIconsGen {
const $AssetsIconsGen();
/// File path: assets/icons/arrow_down.svg
SvgGenImage get arrowDown => const SvgGenImage('assets/icons/arrow_down.svg');
/// File path: assets/icons/arrow_left.svg
SvgGenImage get arrowLeft => const SvgGenImage('assets/icons/arrow_left.svg');
List<SvgGenImage> get svgAssets => [arrowDown, arrowLeft];
}
The reason is that we have an internal design component library app that displays all the icons together
Also looking for this feature! In our project we have 100+ icons and I want a page with a list of currently imported icons with its names. Looking thru files is not always an option or a convenient one for svg on macOS (you basically have to convert em all to PNGs to view adequately sized previews). 'dart:mirrors' is no longer available, so it's hard to simply list all available fields of a class. So it would be a perfect solution to have an option in flutter_gen itself (or as a default behaviour) to also generate a list while there.
@wasabeef any updates on this feature or the PR?