Home > OS >  Having a problem with my Pubspec.yaml file
Having a problem with my Pubspec.yaml file

Time:04-30

I do not understand why this error is coming up. all seems well.[![enter image description here][1]][1]

Error detected in pubspec.yaml:
Error on line 61, column 4: Expected a key while parsing a block mapping.
   ╷
61 │    assets:
   │    ^
   ╵
Please correct the pubspec.yaml file at C:\Users\VICTOR\flutter apps\awsome_app\pubspec.yaml
exit code 1[![enter image description here][3]][3]```


  [1]: https://i.stack.imgur.com/qUxuG.png

 

CodePudding user response:

The YAML format used in pubspec.yaml cares about indentation. Your assets: declaration has an extra space behind it. Remove that extra space. And make sure the - assets\ is also indented properly.

The lines in VSCode will help you align them properly.

CodePudding user response:

the pubspec.yaml is a position based script. The vertical lines in visual studio code will tell you the alignment and indentation requirements. The editor is letting you know that the directive is out of position

  • Related