Flutter: Unable to load asset Image provider: AssetImage(bundle: null, name: “assets/xx/xx.jpg

Flutter图片加载问题,Flutter: Unable to load asset Image provider: AssetImage(bundle: null, name: “assets/images/xx.jpg”)

解决方案:

依赖包添加文件目录路径(在pubspec.yaml文件里)

flutter:
  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true
  assets:
    - assets/images/
    - assets/images/Home/

版权声明:本文为github_37847992原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。