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 143 forks source link

[Bug] & symbol in asset name breaks generator #194

Open mishmash-labs opened 2 years ago

mishmash-labs commented 2 years ago

Having a & in the name of the asset causes the build to fail.



line 222, column 27 of .: Unexpected text 'Crafts'.
    ╷
222 │           String get arts&Crafts =>  'assets/images/superpowers/Arts & Crafts.svg';
    │                           ^^^^^^
    ╵
line 222, column 26 of .: Operator declarations must be preceded by the keyword 'operator'.
    ╷
222 │           String get arts&Crafts =>  'assets/images/superpowers/Arts & Crafts.svg';
    │                          ^
    ╵
line 222, column 26 of .: Methods must have an explicit list of parameters.
    ╷
222 │           String get arts&Crafts =>  'assets/images/superpowers/Arts & Crafts.svg';
    │                          ^
    ╵
line 222, column 26 of .: A function body must be provided.
    ╷
222 │           String get arts&Crafts =>  'assets/images/superpowers/Arts & Crafts.svg';
    │                          ^
    ╵
samithe7 commented 2 years ago

try this in image 'assets/images/superpowers/Arts_&_Crafts.svg'

AlexV525 commented 1 month ago

@bramp Is this solved by your recent changes with identifier names?