Member-only story

Flutter Best Practices, Custom Fonts

Fred Grott
9 min readOct 7, 2021

--

f you look through the Google Flutter Doc examples in how to use custom fonts, you see something like this bonehead thing:

And if you follow that, you end up with a huge mess of themes with dependencies in the wrong place. Text Themes work a way in that if you want to effectively use custom fonts, you should be defining the base text themes. And those base text themes are not what was showed in the Cookbook examples.

I am going to show how Fonts are themed in Flutter and how you can use that knowledge to correctly set up your custom fonts for both light, dark, and high contrast and have it be one small concise text theme file.

The example for this article is found in the intl_fonts subfolder of this repo:

Get Access To My Free Stuff

--

--

Fred Grott
Fred Grott

Responses (1)