For more information on themes,
see the Using Themes to share colors and font styles recipe.

4. Use the font in a specific widget

If you want to apply the font to a specific widget,
such as a Text widget,
provide a TextStyle to the widget.

In this example, apply the RobotoMono font to a single Text widget.
Once again, the fontFamily must match the family name declared in the
pubspec.yaml.

TextStyle

If a TextStyle object specifies a weight
or style for which there is no exact font file,
the engine uses one of the more generic files
for the font and attempts to extrapolate outlines
for the requested weight and style.

Complete example

Fonts

The Raleway and RobotoMono fonts were downloaded from
Google Fonts.

pubspec.yaml

name

custom_fonts

description