Adding Fonts#
Steps to Change Font Family in Flutter
Download the font
Fonts can be downloaded at https://fonts.google.com/
Import the font into your project
Create two folders assets/fonts
Add the .tff file to the Fonts folder
Add the font to the pubspec.yaml file
fonts:
- family: PermanentMarker
fonts:
- asset: Assets/Fonts/PermanentMarker-Regular.ttf
Use the new font in by changing it in the style: attribute of Text or RichText Widget
TextStyle myQuoteStyle = const TextStyle(
fontSize: 36,
fontFamily: 'PermanentMarker',
);
Text("my text here", style: myQuoteStyle)