1 格式错误
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- img/
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware.
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages
运行后会产生如下错误
Error on line 44, column 4 of pubspec.yaml: Expected a key while parsing a block mapping.
assets:
^
原因是 assets相对flutter: 前面多了一个空格
修改后 如下正常
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- img/