Flutter Pub: Expected a key while parsing a block mapping. path:

强颜欢笑 提交于 2019-11-30 03:10:35

Spaces are significant in YAML

assets is indented too far

flutter_test:
  sdk: flutter

flutter:
  uses-material-design: true
  assets:
    - loadjson/person.json
Manikanta chadaram

Error on line 29, column 4: Expected a key while parsing a block mapping. assets:

flutter: uses-material-design: true assets: - assets/images/image.jpg

In my case i just added # in front of uses-material-design: true

Try below code

flutter:   

  # uses-material-design: true 

   assets: 
    - assets/images/image.jpg

its working fine.

In my case, uses-material-design intendation was broke. I put 1 (one) more space before it, and it worked fine.

In My Case, the image was too large to load, decreasing dimension of image worked.

Please make sure that we don't have unwanted whitespace since yaml structure is sensitively considering the white spaces. Please refer the documentation for more info as below link,
https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html

It is because of the indentation of your code.The uses-material-design should be on the same line vertically as the assets:.

 uses-material-design: true

 assets:
   - images/picture.png
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!