Expected "assets" to be a list, but got -assets/images/lakes.png (String).

在flutter中使用图片资源,报错:Expected "assets" to be a list, but got -assets/images/lakes.png (String).


Expected
image.png

异常原因:在pubspec.yaml文件配置图片资源的时候, -assets/images/lakes.png assets前少空格
添加就可以了


image.png

在Flutter中添加资源和图片官网链接

你可能感兴趣的:(Expected "assets" to be a list, but got -assets/images/lakes.png (String).)