Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to apply a theme color to the app's background.
Flutter
MaterialApp(
theme: ThemeData(
scaffoldBackgroundColor: [1],
),
home: Scaffold(),
) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid color names or random values.
✗ Incorrect
Colors.blueGrey is a valid Flutter color constant for theming.
2fill in blank
mediumComplete the code to set the primary color in the theme.
Flutter
ThemeData(
primaryColor: [1],
) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing colors that are too light or transparent.
✗ Incorrect
Colors.purple is a good choice for primaryColor to keep UI consistent.
3fill in blank
hardFix the error in the code to apply text theme color.
Flutter
ThemeData(
textTheme: TextTheme(
bodyText1: TextStyle(color: [1]),
),
) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid color names or colors that reduce readability.
✗ Incorrect
Colors.white is a valid color for text, ensuring readability on dark backgrounds.
4fill in blank
hardFill both blanks to create a consistent button style in the theme.
Flutter
ThemeData(
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
backgroundColor: [1],
foregroundColor: [2],
),
),
) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using transparent colors or low contrast combinations.
✗ Incorrect
Using deepOrange as background and white as foreground creates clear, consistent buttons.
5fill in blank
hardFill all three blanks to define a consistent app bar theme.
Flutter
ThemeData(
appBarTheme: AppBarTheme(
backgroundColor: [1],
iconTheme: IconThemeData(color: [2]),
titleTextStyle: TextStyle(color: [3], fontSize: 20),
),
) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using low contrast colors or inconsistent color choices.
✗ Incorrect
Indigo background with white icons and title text ensures a consistent, readable app bar.