首页 > 建站教程 > APP开发,混合APP >  Flutter 报Expected a key while parsing a block mapping.的错误正文

Flutter 报Expected a key while parsing a block mapping.的错误

我爱模板网在用flutter开发一个app时,报了下面的错误:
D:\flutter\bin\flutter.bat --no-color packages get
Error detected in pubspec.yaml:
Error on line 49, column 4: Expected a key while parsing a block mapping.
   ╷
49 │    assets:
   │    ^
   ╵
Please correct the pubspec.yaml file at G:\flutter\demo\flutter_boss\pubspec.yaml
Process finished with exit code 1

截图如下:



原因是assets和前面没有对齐,看图:



就差一个空格,太严格了。不仔细看还真没注意。把assets前面空格减少一个就行了。太坑了!