flutter_gen icon indicating copy to clipboard operation
flutter_gen copied to clipboard

[Bug] & symbol in asset name breaks generator

Open mishmash-labs opened this issue 2 years ago • 2 comments

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';
    │                          ^
    ╵

mishmash-labs avatar Feb 03 '22 11:02 mishmash-labs

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

samithe7 avatar Feb 10 '22 00:02 samithe7