fullter异常记录

作者: 萍水相逢_程序员 | 来源:发表于2018-10-30 17:25 被阅读302次

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/

相关文章

网友评论

    本文标题:fullter异常记录

    本文链接:https://www.haomeiwen.com/subject/eczgtqtx.html