Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to make the Column scrollable using SingleChildScrollView.
Flutter
SingleChildScrollView(
child: Column(
children: [
Text('Item 1'),
Text('Item 2'),
Text('Item 3'),
],
),
[1]: Axis.vertical,
) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'direction' or 'axis' instead of 'scrollDirection'.
Forgetting to wrap the Column with SingleChildScrollView.
✗ Incorrect
The property to set scroll direction in SingleChildScrollView is scrollDirection.
2fill in blank
mediumComplete the code to add padding inside SingleChildScrollView.
Flutter
SingleChildScrollView( padding: EdgeInsets.[1](16), child: Text('Scrollable content'), )
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using EdgeInsets.symmetric or EdgeInsets.only when equal padding is needed.
Not adding padding inside SingleChildScrollView.
✗ Incorrect
EdgeInsets.all(16) adds equal padding on all sides inside SingleChildScrollView.
3fill in blank
hardFix the error in the code to make the SingleChildScrollView scroll horizontally.
Flutter
SingleChildScrollView(
scrollDirection: [1],
child: Row(
children: [
Icon(Icons.star),
Icon(Icons.star_border),
],
),
) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using ScrollDirection instead of Axis.
Setting scrollDirection to Axis.vertical for horizontal scroll.
✗ Incorrect
To scroll horizontally, scrollDirection must be Axis.horizontal.
4fill in blank
hardFill both blanks to create a scrollable list with padding and vertical scroll direction.
Flutter
SingleChildScrollView( [1]: Axis.[2], padding: EdgeInsets.all(12), child: Column( children: [ Text('Line 1'), Text('Line 2'), ], ), )
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing padding with scrollDirection.
Using horizontal instead of vertical for vertical scroll.
✗ Incorrect
scrollDirection sets the scroll axis, and Axis.vertical means vertical scrolling.
5fill in blank
hardFill all three blanks to create a horizontally scrollable SingleChildScrollView with symmetric padding.
Flutter
SingleChildScrollView( [1]: Axis.[2], padding: EdgeInsets.[3](horizontal: 20, vertical: 10), child: Row( children: [ Icon(Icons.home), Icon(Icons.settings), ], ), )
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using vertical instead of horizontal for horizontal scroll.
Using EdgeInsets.all instead of EdgeInsets.symmetric for different horizontal and vertical padding.
✗ Incorrect
scrollDirection sets the scroll axis, Axis.horizontal for horizontal scroll, and EdgeInsets.symmetric for padding on horizontal and vertical sides.