Recall & Review
beginner
What is the first step to use a custom font in a Flutter app?
Add the font files (usually .ttf or .otf) to your project folder, typically under an assets or fonts directory.
Click to reveal answer
beginner
How do you tell Flutter about your custom fonts?
You declare the font in the pubspec.yaml file under the 'fonts' section, specifying the font family name and the path to the font files.
Click to reveal answer
beginner
How do you apply a custom font to a Text widget in Flutter?
Use the TextStyle class with the 'fontFamily' property set to the font family name you declared in pubspec.yaml.Click to reveal answer
intermediate
Why is it important to declare multiple font weights in your custom font setup?
Declaring multiple weights (like regular, bold) allows Flutter to use the correct font style automatically when you set fontWeight in TextStyle.
Click to reveal answer
beginner
What happens if you forget to run 'flutter pub get' after adding fonts to pubspec.yaml?
Flutter won't recognize the new fonts and your app may show default fonts or errors when trying to use the custom font.
Click to reveal answer
Where should you place your custom font files in a Flutter project?
✗ Incorrect
Custom fonts should be inside your project folder, usually in assets or fonts, so Flutter can include them in the app bundle.
Which file do you edit to register custom fonts in Flutter?
✗ Incorrect
The pubspec.yaml file is where you declare assets and fonts for Flutter to use.
How do you specify the font family in a Text widget?
✗ Incorrect
You use the fontFamily property inside TextStyle to apply a custom font.
What is the purpose of declaring multiple font weights in pubspec.yaml?
✗ Incorrect
Multiple font weights let Flutter pick the right style automatically when you use fontWeight.
What command should you run after editing pubspec.yaml to add fonts?
✗ Incorrect
flutter pub get downloads and registers new assets and dependencies declared in pubspec.yaml.
Explain the steps to add and use a custom font in a Flutter app.
Think about where the font files go, how Flutter knows about them, and how to apply them in code.
You got /4 concepts.
Why is it helpful to declare different font weights for a custom font in Flutter?
Consider how text styles like bold or light are controlled.
You got /3 concepts.