Recall & Review
beginner
What is the purpose of the
Text widget in Flutter?The
Text widget displays a string of text with single style in the app's UI. It is used to show readable content to users.Click to reveal answer
beginner
How do you change the color of text in a
Text widget?You change the text color by using the
style property with a TextStyle object, setting its color property, e.g., Text('Hello', style: TextStyle(color: Colors.red)).Click to reveal answer
beginner
What property of
TextStyle controls the font size?The
fontSize property controls the size of the text font, for example: TextStyle(fontSize: 20) makes the text larger.Click to reveal answer
beginner
How can you make text bold using the
Text widget?Use the
fontWeight property inside TextStyle and set it to FontWeight.bold, like Text('Bold', style: TextStyle(fontWeight: FontWeight.bold)).Click to reveal answer
beginner
What does the
textAlign property do in a Text widget?The
textAlign property controls how the text is aligned horizontally within its container, such as TextAlign.left, TextAlign.center, or TextAlign.right.Click to reveal answer
Which property is used to change the font size of a Text widget?
✗ Incorrect
The fontSize property inside TextStyle sets the size of the text.
How do you make text italic in Flutter?
✗ Incorrect
Use fontStyle: FontStyle.italic inside TextStyle to make text italic.
What does the
textAlign property affect?✗ Incorrect
textAlign controls how text is aligned horizontally inside its container.
Which widget is used to display text in Flutter?
✗ Incorrect
The Text widget displays text on the screen.
How do you change the color of text to blue?
✗ Incorrect
You set the color inside TextStyle using the color property.
Explain how to style text in Flutter using the Text widget and TextStyle.
Think about how you change color, size, weight, and alignment.
You got /7 concepts.
Describe the role of the textAlign property and give examples of its values.
Consider how text looks inside a box when aligned differently.
You got /5 concepts.