Recall & Review
beginner
What is a List in Flutter?
A List is an ordered collection of items. You can add, remove, or access items by their position (index). Think of it like a shopping list where order matters.
Click to reveal answer
beginner
How does a Map work in Flutter?
A Map stores data as key-value pairs. Each key is unique and points to a value. It's like a dictionary where you look up a word (key) to find its meaning (value).
Click to reveal answer
beginner
What is a Set in Flutter and when to use it?
A Set is a collection of unique items with no order. Use it when you want to store items but avoid duplicates, like a guest list where each name appears once.
Click to reveal answer
beginner
How do you add an item to a List in Flutter?
Use the add() method. For example: myList.add('apple'); This adds 'apple' to the end of the list.
Click to reveal answer
intermediate
How to check if a Map contains a key in Flutter?
Use the containsKey() method. For example: myMap.containsKey('name') returns true if 'name' is a key in the map.
Click to reveal answer
Which Flutter collection type stores items in a specific order and allows duplicates?
✗ Incorrect
Lists keep items in order and allow duplicates.
What does a Map in Flutter use to access its values?
✗ Incorrect
Maps use keys to access their values.
Which collection type automatically prevents duplicate items?
✗ Incorrect
Sets only store unique items.
How do you add a new key-value pair to a Map in Flutter?
✗ Incorrect
Use myMap['key'] = 'value' to add or update entries.
Which method checks if a List contains a specific item?
✗ Incorrect
The contains() method checks for an item in a List.
Explain the differences between Lists, Maps, and Sets in Flutter.
Think about how you store and access data in each collection.
You got /3 concepts.
Describe a real-life example where you would use a Set instead of a List.
Consider situations where repeating items cause problems.
You got /3 concepts.