Open Nico04 opened 11 months ago
Even though this looks good. If its related to data or state, I think you should separate UI and logic. Create enum instead, and use switch from that.
child: switch(enumValue) {
SomeEnum.Type1: Assets.breath.svg(),
....
}
Is there an existing issue for this?
Describe the problem
I have several const that defines some static data in my app. Before using
flutter_gen
, I could write something like this :const breath = MultiSelectorItem('breath', 'assets/breath.svg', 'Breath');
But when using
flutter_gen
, this line doesn't work anymore :const breath = MultiSelectorItem('breath', Assets.breath.path, 'Breath');
Describe the solution
It seems that it's because the generated class
SvgGenImage.path
is a getter, so NOT const.Do you have an idea how can I use the asset path in a const ?
Additional context
I now I could remove
flutter_svg: true
inpubspec
, but using this kind of code is also handy :child: Assets.breath.svg()
Request looks similar to #351, but it is somewhat different.
Code of Conduct