1 格式错误
#应用的名字
name: flutter_app
description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
#添加依赖的包
dependencies:
flutter:
sdk: flutter
#第三方开源应用
cupertino_icons: ^0.1.2
english_words: ^3.1.0
dev_dependencies:
flutter_test:
sdk: flutter
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- images/
运行后会产生如下错误
Error on line 44, column 4 of pubspec.yaml: Expected a key while parsing a block mapping.
assets:
^
原因是 assets相对flutter: 前面多了一个空格
修改后 如下正常
#应用的名字
name: flutter_app
description: A new Flutter application.
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
#添加依赖的包
dependencies:
flutter:
sdk: flutter
#第三方开源应用
cupertino_icons: ^0.1.2
english_words: ^3.1.0
dev_dependencies:
flutter_test:
sdk: flutter
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- images/