FlutterGen / flutter_gen

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.
https://pub.dev/packages/flutter_gen
MIT License
1.44k stars 142 forks source link

error when png name is start with number #250

Closed hello-soon closed 3 months ago

hello-soon commented 2 years ago

assets/images/olp/2.png

image
Linkadi98 commented 2 years ago

you have to rename image file to image1 or something not start with a number because dart doesn't allow that

DevNico commented 11 months ago

I don't think this should error though. By default it should either be ignored / warned about in the build runner output or replace any invalid characters with e.g. an _ as well as prepend it with an _ if required.

ellet0 commented 7 months ago

you have to rename image file to image1 or something not start with a number because dart doesn't allow that

Hi, is it a good idea if the package provided a handling for this case??

Linkadi98 commented 7 months ago

you have to rename image file to image1 or something not start with a number because dart doesn't allow that

Hi, is it a good idea if the package provided a handling for this case??

I think the package should do what it does, this issue is depended on us IMO. The package only should show specific error to us and has nothing to do with this issue.

bramp commented 7 months ago

I tried to fix this, and just naming issues here: https://github.com/FlutterGen/flutter_gen/pull/433. Just waiting for a review