Reputation: 1
assets:
- assets/
fonts:
- family: Schyler
fonts:
- asset: fonts/Schyler-Regular.ttf
- asset: fonts/Schyler-Italic.ttf
- family: Trajan Pro
fonts:
- asset: fonts/TrajanPro.ttf
- asset: fonts/TrajanPro_Bold.ttf
weight: 700
I wanted to add this font to assets
Upvotes: 0
Views: 280
Reputation: 63559
Try to follow the exact indentation from flutter
# The following section is specific to Flutter packages.
flutter:
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/
fonts:
- family: Schyler
fonts:
- asset: fonts/TrajanPro.ttf
- asset: fonts/TrajanPro_Bold.ttf
weight: 700
here every dot represent single space
Check more about adding assets-and-images.
Upvotes: 0
Reputation: 603
It's more likely that the indentation of the whole block is wrong (or missing).
Read the following link.
Upvotes: 0
Reputation: 5792
your indentation is not correct pubspec.yaml is giving error when you have wrong indentation in it give a tab space before
fonts:
check out this screen shot and make the indentation like this
Upvotes: 1