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

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


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

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.


Spaces are significant in YAML

assets is indented too far

flutter_test:
  sdk: flutter

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