I wanted to add this font to assets

182 views Asked by At

enter image description here

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

3

There are 3 answers

0
Munsif Ali On

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 enter image description here

0
A. Rokbi On

It's more likely that the indentation of the whole block is wrong (or missing).

Read the following link.

0
Md. Yeasin Sheikh On

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

enter image description here

Check more about adding assets-and-images.