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?
✗ Incorrect
ListView.builder builds children on demand, which is efficient for long lists.How do you make a
ListView scroll horizontally?✗ Incorrect
The
scrollDirection property controls the scroll axis.What happens if you use
ListView with many children without builder?✗ Incorrect
ListView with fixed children builds all widgets immediately.Which property do you use to provide the list of widgets in a simple
ListView?✗ Incorrect
The
children property takes a list of widgets.What is the default scroll direction of a
ListView?✗ Incorrect
By default,
ListView scrolls vertically.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.