Flutter引用本地图片报错

报错内容为:

Expected "assets" to be a list, but got -Images/3.0x/222..jpg (String). Please correct the pubspec.yaml file at 

配置是这样的:

uses-material-design: true
assets:
-Images/3.0x/222.jpg

报错原因:
‘-’之后要跟一个空格。。。就很无语

  uses-material-design: true
  assets:
    - Images/3.0x/222.jpg

改之后不再报错

猜你喜欢

转载自blog.csdn.net/weixin_46136019/article/details/129172176