0
0
Fluttermobile~5 mins

ListView basics in Flutter - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a ListView in Flutter?
A ListView is a scrollable list of widgets arranged linearly. It allows users to scroll through a list of items vertically or horizontally.
Click to reveal answer
beginner
How do you create a simple vertical ListView with fixed children?
Use ListView(children: [Widget1, Widget2, ...]) to create a scrollable list with a fixed set of widgets.
Click to reveal answer
intermediate
What is the difference between ListView and ListView.builder?
ListView takes a fixed list of children, while ListView.builder creates children on demand, which is efficient for long or infinite lists.
Click to reveal answer
intermediate
Why should you use ListView.builder for large lists?
Because it builds only the visible items plus a few extra, saving memory and improving performance compared to building all items at once.
Click to reveal answer
beginner
How can you make a ListView scroll horizontally?
Set the scrollDirection property to Axis.horizontal in the ListView constructor.
Click to reveal answer
Which widget creates a scrollable list that builds its children lazily?
AListView.builder
BListView
CColumn
DRow
How do you make a ListView scroll horizontally?
AUse <code>ListView.vertical()</code>
BWrap it in a <code>Row</code>
CSet <code>scrollDirection: Axis.horizontal</code>
DSet <code>direction: horizontal</code>
What happens if you use ListView with many children without builder?
AAll children are built at once, which may cause performance issues
BChildren are built lazily
CThe list scrolls horizontally by default
DThe list will not scroll
Which property do you use to provide the list of widgets in a simple ListView?
Awidgets
Bchildren
Celements
Ditems
What is the default scroll direction of a ListView?
ANone
BHorizontal
CDiagonal
DVertical
Explain how to create a scrollable vertical list of text items in Flutter using ListView.
Think about how you put multiple widgets inside a scrollable container.
You got /4 concepts.
    Describe the benefits of using ListView.builder over a simple ListView with many children.
    Consider what happens when you have a very long list.
    You got /4 concepts.