Search⌘ K
AI Features

Solution: Application Fonts

Explore how to integrate and apply custom fonts in Flutter applications. Learn to import font files via pubspec.yaml, set a default app font using themes, and assign specific fonts to text widgets for enhanced UI design.

Solutions

Great job on completing all the steps in the previous challenge. Feel free to compare your code solutions with the solutions below:

pubspec.yaml
lib/main.dart
lib/contact_list_screen.dart
# TODO: CHALLENGE #1 - Import font files
fonts:
- family: Oswald
fonts:
- asset: assets/fonts/Oswald-VariableFont_wght.ttf
- family: Poppins
fonts:
- asset: assets/fonts/Poppins-Regular.ttf
- asset: assets/fonts/Poppins-Bold.ttf
- asset: assets/fonts/Poppins-Italic.ttf
pubspec.yaml

Challenge 1: Import font files

...