Challenge - 5 Problems
ListTile Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ ui_behavior
intermediate2:00remaining
What is the output of this ListTile code?
Given the following Flutter code snippet, what will be displayed on the screen?
Flutter
ListTile( leading: Icon(Icons.star), title: Text('Favorite'), subtitle: Text('Tap to select'), trailing: Icon(Icons.arrow_forward), )
Attempts:
2 left
💡 Hint
Think about what each property (leading, title, subtitle, trailing) does in ListTile.
✗ Incorrect
The ListTile widget arranges leading icon on the left, title and subtitle stacked vertically in the center, and trailing icon on the right.
❓ ui_behavior
intermediate2:00remaining
What happens when you tap a ListTile with onTap set?
Consider this ListTile:
ListTile(
title: Text('Click me'),
onTap: () { print('Tapped'); },
)
What happens when the user taps this ListTile?
Attempts:
2 left
💡 Hint
onTap is a callback for tap gestures.
✗ Incorrect
When onTap is set, tapping the ListTile triggers the callback and shows a ripple effect by default.
📝 Syntax
advanced2:00remaining
Which option causes a syntax error in ListTile usage?
Identify the option that will cause a syntax error when used in Flutter code.
Attempts:
2 left
💡 Hint
Check for missing colons between property names and values.
✗ Incorrect
Option D is missing a colon after 'trailing', causing a syntax error.
❓ ui_behavior
advanced2:00remaining
What is the effect of wrapping ListTile with InkWell?
If you wrap a ListTile inside an InkWell widget with an onTap handler, what changes in behavior or appearance occur?
Attempts:
2 left
💡 Hint
Nested interactive Material widgets like InkWell and ListTile both respond to taps.
✗ Incorrect
Wrapping ListTile with InkWell results in both widgets handling the tap: both onTap callbacks fire (if set) and both ripple effects are visible simultaneously.
🔧 Debug
expert2:00remaining
Does this ListTile show the subtitle?
Given this code:
ListTile(
title: Text('Title'),
subtitle: Text('Subtitle'),
isThreeLine: false,
)
Is the subtitle visible on the screen?
Attempts:
2 left
💡 Hint
isThreeLine affects layout height and line count, but not whether subtitle is displayed.
✗ Incorrect
Option B is correct. The subtitle is always displayed below the title if provided, regardless of isThreeLine. When false, it uses a two-line layout; when true, up to three lines.