Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to create a ListTile with a title text.
Flutter
ListTile(
title: Text([1]),
) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around the string.
Passing a plain string instead of a Text widget.
✗ Incorrect
The title property expects a Widget, so we use Text widget with a string inside quotes.
2fill in blank
mediumComplete the code to add a leading icon to the ListTile.
Flutter
ListTile( leading: Icon([1]), title: Text('Menu'), )
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong case like Icons.Menu or Icon.menu.
Passing a string instead of Icons.menu.
✗ Incorrect
The leading icon uses Icons.menu with lowercase 'menu' and capital 'I' in Icons.
3fill in blank
hardFix the error in the ListTile to add a subtitle text.
Flutter
ListTile( title: Text('Title'), subtitle: [1]('Subtitle'), )
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase 'text' instead of 'Text'.
Passing a string directly without Text widget.
✗ Incorrect
The subtitle property also expects a Text widget with the subtitle string.
4fill in blank
hardFill both blanks to create a ListTile with a trailing icon and a tap action.
Flutter
ListTile( title: Text('Settings'), trailing: Icon([1]), onTap: () => [2]('Tapped!'), )
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong icon name or case.
Using alert instead of print for onTap.
✗ Incorrect
The trailing icon uses Icons.settings and the onTap action calls print to show a message.
5fill in blank
hardFill all three blanks to create a ListTile with a leading icon, title, and a subtitle.
Flutter
ListTile( leading: Icon([1]), title: Text([2]), subtitle: Text([3]), )
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong icon name like Icons.user.
Forgetting quotes around title or subtitle strings.
✗ Incorrect
The leading icon is Icons.account_circle, the title is 'User Name', and the subtitle is 'Active now'.