font-size: 1rem;](In this article, I've explained how to use alternate fonts in Flutter.
font-size: 1rem;](
font-size: 1rem;](
font-size: 1rem;](In flutter, we have 2 options to change the fonts.
- Use as a default app font.
- Use for a specific widget.
But before that, you need to download the fonts from [https://fonts.google.com/font-size: 1rem;](https://fonts.google.com/) or any other alternate location you know.
And then add that to the pubspec.yaml file. Example below,
Once added to the pubspec.yaml file, you are ready to use them in the app. So, let's explore the 2 options we have to change the fonts of the app.
1. Use as a default app font.
In order to change the default font of the app so that all the widgets can use the same fond, you need to set it as a fontFamily in side ThemeData. Example below,
2. Use for a specific widget.
In order to change the font of a specific Text widget, pass it through fontFamily property of TextStyle. Example below,
If you want more fonts that are free for commercial use, check this link [https://www.websiteplanet.com/blog/best-free-fonts/target="_blankdata-saferedirecturl="https://www.google.com/url?q=https://www.websiteplanet.com/blog/best-free-fonts/&source=gmail&ust=1594431288632000&usg=AFQjCNFk5qWk4GU9C0Y31FuvULZclMspVgcolor: rgb(17, 85, 204); font-family: Arial, Helvetica, sans-serif; font-size: small; background-color: rgb(255, 255, 255);](https://www.websiteplanet.com/blog/best-free-fonts/)
Thanks, Srikanth