Home > Software design >  fonts on pubspec.yaml, doesn't display my font correctly
fonts on pubspec.yaml, doesn't display my font correctly

Time:10-23

i recently change pubspec.yaml file but flutter can't display my font

  fonts:
    - family: Amatic
      fonts:
       - asset: assets/fonts/Amatic-Bold.ttf
       - asset: assets/fonts/Amatic-Regular.ttf

CodePudding user response:

.yaml files are case sensitive. So, you have to give us your pubspec.yaml file as it is. If you are not formatting the content as it should be, you will no get what you expect.

CodePudding user response:

inside your GetMaterialApp at the main file inside theme you should add

fontFamily: 'The name of your font in the assets'
  • Related