0
0
Fluttermobile~5 mins

Checkbox and Switch in Flutter - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Checkbox widget used for in Flutter?
A Checkbox widget lets users select or deselect an option. It shows a small box that can be checked or unchecked.
Click to reveal answer
beginner
How does a Switch widget differ from a Checkbox in Flutter?
A Switch widget is a toggle button that slides between ON and OFF states, often used for settings. A Checkbox is a box that can be checked or unchecked.
Click to reveal answer
beginner
Which property controls whether a Checkbox or Switch is selected or not?
The 'value' property controls if the Checkbox or Switch is selected (true) or not (false).
Click to reveal answer
beginner
What is the purpose of the 'onChanged' callback in Checkbox and Switch widgets?
The 'onChanged' callback runs when the user taps the widget. It lets the app update the state to reflect the new selection.
Click to reveal answer
intermediate
How can you make a Checkbox or Switch disabled in Flutter?
Set the 'onChanged' property to null. This disables the widget and prevents user interaction.
Click to reveal answer
What type of value does the 'value' property of a Checkbox expect?
AList
BBoolean (true or false)
CInteger
DString
Which widget would you use to let users toggle a setting ON or OFF with a sliding button?
ASwitch
BCheckbox
CRadio
DSlider
How do you disable a Checkbox so the user cannot change its state?
AWrap it in a Disabled widget
BSet 'value' to false
CSet 'enabled' to false
DSet 'onChanged' to null
What happens when the user taps a Checkbox with a valid 'onChanged' callback?
ANothing happens
BThe app crashes
CThe Checkbox toggles its state and 'onChanged' runs
DThe Checkbox disappears
Which property do you use to listen for changes in a Switch widget?
AonChanged
BonSwitch
ConTap
DonToggle
Explain how to create a Checkbox in Flutter that updates its state when tapped.
Think about how the Checkbox knows if it is checked and how to update that.
You got /4 concepts.
    Describe the differences and typical uses of Checkbox and Switch widgets in Flutter.
    Consider how users interact with each and what UI they expect.
    You got /4 concepts.