在Flutter中构建布局图片不能显示的坑

在Flutter中构建布局图片不能显示的坑_第1张图片

Flutter整个过程都挺顺利,唯独头图死活加载不出来,然后去审查pubspec.yaml文件的资源配置,直觉这里可能需要一个空格都不能落下,最终确认确实是添加资源文件空格问题~

  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
   - images/top.jpg
  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.io/assets-and-images/#resolution-aware.

“assets:”一定要与上面对其,“-”对其assets后前面和后面都要空一格,然后再写路径:

在Flutter中构建布局图片不能显示的坑_第2张图片

你可能感兴趣的:(Flutter开发)