0
0
Fluttermobile~20 mins

ListTile widget in Flutter - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
ListTile Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
ui_behavior
intermediate
2: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),
)
AA list item with a star icon on the left, title 'Favorite', subtitle 'Tap to select', and an arrow icon on the right.
BA list item with only the title 'Favorite' centered and no icons.
CA list item with the title and subtitle stacked vertically but no icons.
DAn error because trailing icon is not allowed in ListTile.
Attempts:
2 left
💡 Hint
Think about what each property (leading, title, subtitle, trailing) does in ListTile.
ui_behavior
intermediate
2: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?
AThe app crashes because onTap requires a return value.
BNothing happens because onTap is not a valid property.
CThe text 'Tapped' is printed to the console and the ListTile shows a ripple effect.
DThe ListTile disappears from the screen.
Attempts:
2 left
💡 Hint
onTap is a callback for tap gestures.
📝 Syntax
advanced
2:00remaining
Which option causes a syntax error in ListTile usage?
Identify the option that will cause a syntax error when used in Flutter code.
AListTile(title: Text('Hello'), onTap: () => print('Tapped'))
BListTile(title: Text('Hello'), subtitle: Text('Subtitle'))
CListTile(title: Text('Hello'), leading: Icon(Icons.home))
DListTile(title: Text('Hello'), trailing Icon(Icons.arrow_forward))
Attempts:
2 left
💡 Hint
Check for missing colons between property names and values.
ui_behavior
advanced
2: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?
AThere is no visual or functional change; both ripple effects appear simultaneously.
BThe ListTile loses its default ripple effect and only InkWell's ripple is shown on tap.
CThe ListTile's onTap stops working and InkWell's onTap is ignored.
DThe app crashes because ListTile cannot be wrapped by InkWell.
Attempts:
2 left
💡 Hint
Nested interactive Material widgets like InkWell and ListTile both respond to taps.
🔧 Debug
expert
2: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?
ABecause isThreeLine is false, subtitle is hidden unless isThreeLine is true.
BBecause subtitle is always shown regardless of isThreeLine value.
CBecause isThreeLine false means subtitle is shown only if title is empty.
DBecause subtitle requires isThreeLine to be true to display below title.
Attempts:
2 left
💡 Hint
isThreeLine affects layout height and line count, but not whether subtitle is displayed.