I have problem when I custom font on Flutter
My folder font
myapp/fonts/SairaSemiCondensed-Bold.ttf
here my pubspec.ymal
fonts:
- family: SairaSemiCondensed
fonts:
- asset: fonts/fonts:SairaSemiCondensed-Bold.ttf
weight: 700
I got error like this
Error on line 55, column 4 of pubspec.yaml: Expected a key while parsing a
block mapping.
fonts:
^
pub get failed (65)
Can anyone help me?
Try
fonts:
- family: SairaSemiCondensed
fonts:
- asset: fonts/fonts:SairaSemiCondensed-Bold.ttf
weight: 700 # indented more
but it's more likely that the indentation of the whole block is wrong (or missing). Try to indent all lines in your questions one tab or 2 spaces more.
Indentation is significant in yaml.
Try to follow indentation exactly as shown in https://flutter.io/docs/cookbook/design/fonts if my suggestion above doesn't work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With