flutter_gen icon indicating copy to clipboard operation
flutter_gen copied to clipboard

Support numbers only file names

Open jonasbark opened this issue 3 years ago • 2 comments

[SEVERE] 
Could not format because the source could not be parsed:

line 105, column 25 of .: Methods must have an explicit list of parameters.
    ╷
105 │   AssetGenImage get 460 => const AssetGenImage('assets/images/placeholders/460.jpg');

A current workaround would be to rename all the files to e.g. p_460.jpg

jonasbark avatar Jul 27 '21 06:07 jonasbark

我也出现了一样的问题。

 Could not format because the source could not be parsed:
  
  line 19, column 23 of .: Expected a class member.
     ╷
  19 │     AssetGenImage get 3Arrows => const AssetGenImage('assets/icons/3_arrows.png');
     │                       ^
     ╵
  line 19, column 24 of .: Methods must have an explicit list of parameters.
     ╷
  19 │     AssetGenImage get 3Arrows => const AssetGenImage('assets/icons/3_arrows.png');
     │                        ^^^^^^
     ╵
  line 19, column 19 of .: Expected to find ';'.
     ╷
  19 │     AssetGenImage get 3Arrows => const AssetGenImage('assets/icons/3_arrows.png');
     │                   ^^^
     ╵
  [INFO] Reading cached asset graph completed, took 325ms

将文件名改成字母开头可以正常生成

meng-fucius avatar Sep 08 '21 02:09 meng-fucius

Same for me for file names like: [email protected]

elianortega avatar Oct 11 '21 18:10 elianortega