在Flutter中構建佈局圖片不能顯示的坑

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後前面和後面都要空一格,然後再寫路徑:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章