问题
Error on line 55, column 4 of pubspec.yaml: Expected a key while parsing a block mapping. fonts:
回答1:
fonts: - family: Heebo fonts: - asset: fonts/Heebo-Regular.ttf - asset: fonts/Heebo-Bold.ttf weight: 700 - asset: fonts/Heebo-Black.ttf weight: 400
there is requre two spaces in between fonts and family
回答2:
1.In Android Studio, you need to create a package under lib folder. For example you create a package fonts (path is app_name/lib/fonts).
2.In the pubspec.yaml the code would look like:
flutter:
fonts:
- family: Oxygen
fonts:
- asset: app_widgets/lib/fonts/Oxygen-Regular.ttf
- asset: app_widgets/lib/fonts/Oxygen-Bold.ttf
weight: 700
- asset: app_widgets/lib/fonts/Oxygen-Light.ttf
weight: 300
来源:https://stackoverflow.com/questions/55470780/error-on-line-55-column-4-of-pubspec-yaml-expected-a-key-while-parsing-a-block